annotate lisp/gnus/gnus-sum.el @ 120:cca96a509cfe r20-1b12

Import from CVS: tag r20-1b12
author cvs
date Mon, 13 Aug 2007 09:25:29 +0200
parents 7d55a9ba150c
children d2f30a177268
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1 ;;; gnus-sum.el --- summary mode commands for Gnus
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2 ;; Copyright (C) 1996,97 Free Software Foundation, Inc.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5 ;; Keywords: news
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
12 ;; any later version.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
13
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
17 ;; GNU General Public License for more details.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
18
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
22 ;; Boston, MA 02111-1307, USA.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
23
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
24 ;;; Commentary:
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
25
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
26 ;;; Code:
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
27
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
28 (require 'gnus)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
29 (require 'gnus-group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
30 (require 'gnus-spec)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
31 (require 'gnus-range)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
32 (require 'gnus-int)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
33 (require 'gnus-undo)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
34
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
35 (defcustom gnus-kill-summary-on-exit t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
36 "*If non-nil, kill the summary buffer when you exit from it.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
37 If nil, the summary will become a \"*Dead Summary*\" buffer, and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
38 it will be killed sometime later."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
39 :group 'gnus-summary-exit
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
40 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
41
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
42 (defcustom gnus-fetch-old-headers nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
43 "*Non-nil means that Gnus will try to build threads by grabbing old headers.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
44 If an unread article in the group refers to an older, already read (or
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
45 just marked as read) article, the old article will not normally be
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
46 displayed in the Summary buffer. If this variable is non-nil, Gnus
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
47 will attempt to grab the headers to the old articles, and thereby
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
48 build complete threads. If it has the value `some', only enough
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
49 headers to connect otherwise loose threads will be displayed.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
50 This variable can also be a number. In that case, no more than that
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
51 number of old headers will be fetched.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
52
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
53 The server has to support NOV for any of this to work."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
54 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
55 :type '(choice (const :tag "off" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
56 (const some)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
57 number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
58 (sexp :menu-tag "other" t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
59
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
60 (defcustom gnus-summary-make-false-root 'adopt
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
61 "*nil means that Gnus won't gather loose threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
62 If the root of a thread has expired or been read in a previous
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
63 session, the information necessary to build a complete thread has been
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
64 lost. Instead of having many small sub-threads from this original thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
65 scattered all over the summary buffer, Gnus can gather them.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
66
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
67 If non-nil, Gnus will try to gather all loose sub-threads from an
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
68 original thread into one large thread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
69
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
70 If this variable is non-nil, it should be one of `none', `adopt',
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
71 `dummy' or `empty'.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
72
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
73 If this variable is `none', Gnus will not make a false root, but just
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
74 present the sub-threads after another.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
75 If this variable is `dummy', Gnus will create a dummy root that will
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
76 have all the sub-threads as children.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
77 If this variable is `adopt', Gnus will make one of the \"children\"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
78 the parent and mark all the step-children as such.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
79 If this variable is `empty', the \"children\" are printed with empty
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
80 subject fields. (Or rather, they will be printed with a string
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
81 given by the `gnus-summary-same-subject' variable.)"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
82 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
83 :type '(choice (const :tag "off" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
84 (const none)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
85 (const dummy)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
86 (const adopt)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
87 (const empty)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
88
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
89 (defcustom gnus-summary-gather-exclude-subject "^ *$\\|^(none)$"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
90 "*A regexp to match subjects to be excluded from loose thread gathering.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
91 As loose thread gathering is done on subjects only, that means that
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
92 there can be many false gatherings performed. By rooting out certain
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
93 common subjects, gathering might become saner."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
94 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
95 :type 'regexp)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
96
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
97 (defcustom gnus-summary-gather-subject-limit nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
98 "*Maximum length of subject comparisons when gathering loose threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
99 Use nil to compare full subjects. Setting this variable to a low
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
100 number will help gather threads that have been corrupted by
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
101 newsreaders chopping off subject lines, but it might also mean that
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
102 unrelated articles that have subject that happen to begin with the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
103 same few characters will be incorrectly gathered.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
104
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
105 If this variable is `fuzzy', Gnus will use a fuzzy algorithm when
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
106 comparing subjects."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
107 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
108 :type '(choice (const :tag "off" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
109 (const fuzzy)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
110 (sexp :menu-tag "on" t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
111
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
112 (defcustom gnus-simplify-ignored-prefixes nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
113 "*Regexp, matches for which are removed from subject lines when simplifying fuzzily."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
114 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
115 :type '(choice (const :tag "off" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
116 regexp))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
117
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
118 (defcustom gnus-build-sparse-threads nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
119 "*If non-nil, fill in the gaps in threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
120 If `some', only fill in the gaps that are needed to tie loose threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
121 together. If `more', fill in all leaf nodes that Gnus can find. If
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
122 non-nil and non-`some', fill in all gaps that Gnus manages to guess."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
123 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
124 :type '(choice (const :tag "off" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
125 (const some)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
126 (const more)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
127 (sexp :menu-tag "all" t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
128
112
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
129 (defcustom gnus-summary-thread-gathering-function
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
130 'gnus-gather-threads-by-subject
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
131 "Function used for gathering loose threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
132 There are two pre-defined functions: `gnus-gather-threads-by-subject',
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
133 which only takes Subjects into consideration; and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
134 `gnus-gather-threads-by-references', which compared the References
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
135 headers of the articles to find matches."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
136 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
137 :type '(set (function-item gnus-gather-threads-by-subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
138 (function-item gnus-gather-threads-by-references)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
139 (function :tag "other")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
140
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
141 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
142 (defcustom gnus-summary-same-subject ""
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
143 "*String indicating that the current article has the same subject as the previous.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
144 This variable will only be used if the value of
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
145 `gnus-summary-make-false-root' is `empty'."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
146 :group 'gnus-summary-format
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
147 :type 'string)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
148
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
149 (defcustom gnus-summary-goto-unread t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
150 "*If t, marking commands will go to the next unread article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
151 If `never', commands that usually go to the next unread article, will
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
152 go to the next article, whether it is read or not.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
153 If nil, only the marking commands will go to the next (un)read article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
154 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
155 :link '(custom-manual "(gnus)Setting Marks")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
156 :type '(choice (const :tag "off" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
157 (const never)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
158 (sexp :menu-tag "on" t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
159
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
160 (defcustom gnus-summary-default-score 0
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
161 "*Default article score level.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
162 All scores generated by the score files will be added to this score.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
163 If this variable is nil, scoring will be disabled."
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
164 :group 'gnus-score-default
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
165 :type '(choice (const :tag "disable")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
166 integer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
167
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
168 (defcustom gnus-summary-zcore-fuzz 0
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
169 "*Fuzziness factor for the zcore in the summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
170 Articles with scores closer than this to `gnus-summary-default-score'
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
171 will not be marked."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
172 :group 'gnus-summary-format
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
173 :type 'integer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
174
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
175 (defcustom gnus-simplify-subject-fuzzy-regexp nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
176 "*Strings to be removed when doing fuzzy matches.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
177 This can either be a regular expression or list of regular expressions
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
178 that will be removed from subject strings if fuzzy subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
179 simplification is selected."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
180 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
181 :type '(repeat regexp))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
182
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
183 (defcustom gnus-show-threads t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
184 "*If non-nil, display threads in summary mode."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
185 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
186 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
187
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
188 (defcustom gnus-thread-hide-subtree nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
189 "*If non-nil, hide all threads initially.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
190 If threads are hidden, you have to run the command
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
191 `gnus-summary-show-thread' by hand or use `gnus-select-article-hook'
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
192 to expose hidden threads."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
193 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
194 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
195
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
196 (defcustom gnus-thread-hide-killed t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
197 "*If non-nil, hide killed threads automatically."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
198 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
199 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
200
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
201 (defcustom gnus-thread-ignore-subject nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
202 "*If non-nil, ignore subjects and do all threading based on the Reference header.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
203 If nil, which is the default, articles that have different subjects
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
204 from their parents will start separate threads."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
205 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
206 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
207
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
208 (defcustom gnus-thread-operation-ignore-subject t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
209 "*If non-nil, subjects will be ignored when doing thread commands.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
210 This affects commands like `gnus-summary-kill-thread' and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
211 `gnus-summary-lower-thread'.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
212
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
213 If this variable is nil, articles in the same thread with different
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
214 subjects will not be included in the operation in question. If this
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
215 variable is `fuzzy', only articles that have subjects that are fuzzily
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
216 equal will be included."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
217 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
218 :type '(choice (const :tag "off" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
219 (const fuzzy)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
220 (sexp :tag "on" t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
221
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
222 (defcustom gnus-thread-indent-level 4
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
223 "*Number that says how much each sub-thread should be indented."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
224 :group 'gnus-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
225 :type 'integer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
226
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
227 (defcustom gnus-auto-extend-newsgroup t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
228 "*If non-nil, extend newsgroup forward and backward when requested."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
229 :group 'gnus-summary-choose
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
230 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
231
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
232 (defcustom gnus-auto-select-first t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
233 "*If nil, don't select the first unread article when entering a group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
234 If this variable is `best', select the highest-scored unread article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
235 in the group. If neither nil nor `best', select the first unread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
236 article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
237
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
238 If you want to prevent automatic selection of the first unread article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
239 in some newsgroups, set the variable to nil in
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
240 `gnus-select-group-hook'."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
241 :group 'gnus-group-select
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
242 :type '(choice (const :tag "none" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
243 (const best)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
244 (sexp :menu-tag "first" t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
245
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
246 (defcustom gnus-auto-select-next t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
247 "*If non-nil, offer to go to the next group from the end of the previous.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
248 If the value is t and the next newsgroup is empty, Gnus will exit
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
249 summary mode and go back to group mode. If the value is neither nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
250 nor t, Gnus will select the following unread newsgroup. In
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
251 particular, if the value is the symbol `quietly', the next unread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
252 newsgroup will be selected without any confirmation, and if it is
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
253 `almost-quietly', the next group will be selected without any
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
254 confirmation if you are located on the last article in the group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
255 Finally, if this variable is `slightly-quietly', the `Z n' command
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
256 will go to the next group without confirmation."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
257 :group 'gnus-summary-maneuvering
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
258 :type '(choice (const :tag "off" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
259 (const quietly)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
260 (const almost-quietly)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
261 (const slightly-quietly)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
262 (sexp :menu-tag "on" t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
263
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
264 (defcustom gnus-auto-select-same nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
265 "*If non-nil, select the next article with the same subject."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
266 :group 'gnus-summary-maneuvering
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
267 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
268
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
269 (defcustom gnus-summary-check-current nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
270 "*If non-nil, consider the current article when moving.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
271 The \"unread\" movement commands will stay on the same line if the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
272 current article is unread."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
273 :group 'gnus-summary-maneuvering
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
274 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
275
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
276 (defcustom gnus-auto-center-summary t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
277 "*If non-nil, always center the current summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
278 In particular, if `vertical' do only vertical recentering. If non-nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
279 and non-`vertical', do both horizontal and vertical recentering."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
280 :group 'gnus-summary-maneuvering
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
281 :type '(choice (const :tag "none" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
282 (const vertical)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
283 (sexp :menu-tag "both" t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
284
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
285 (defcustom gnus-show-all-headers nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
286 "*If non-nil, don't hide any headers."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
287 :group 'gnus-article-hiding
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
288 :group 'gnus-article-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
289 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
290
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
291 (defcustom gnus-summary-ignore-duplicates nil
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
292 "*If non-nil, ignore articles with identical Message-ID headers."
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
293 :group 'gnus-summary
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
294 :type 'boolean)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
295
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
296 (defcustom gnus-single-article-buffer t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
297 "*If non-nil, display all articles in the same buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
298 If nil, each group will get its own article buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
299 :group 'gnus-article-various
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
300 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
301
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
302 (defcustom gnus-break-pages t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
303 "*If non-nil, do page breaking on articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
304 The page delimiter is specified by the `gnus-page-delimiter'
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
305 variable."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
306 :group 'gnus-article-various
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
307 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
308
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
309 (defcustom gnus-show-mime nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
310 "*If non-nil, do mime processing of articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
311 The articles will simply be fed to the function given by
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
312 `gnus-show-mime-method'."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
313 :group 'gnus-article-mime
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
314 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
315
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
316 (defcustom gnus-move-split-methods nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
317 "*Variable used to suggest where articles are to be moved to.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
318 It uses the same syntax as the `gnus-split-methods' variable."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
319 :group 'gnus-summary-mail
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
320 :type '(repeat (choice (list function)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
321 (cons regexp (repeat string))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
322 sexp)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
323
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
324 (defcustom gnus-unread-mark ?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
325 "*Mark used for unread articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
326 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
327 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
328
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
329 (defcustom gnus-ticked-mark ?!
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
330 "*Mark used for ticked articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
331 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
332 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
333
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
334 (defcustom gnus-dormant-mark ??
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
335 "*Mark used for dormant articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
336 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
337 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
338
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
339 (defcustom gnus-del-mark ?r
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
340 "*Mark used for del'd articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
341 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
342 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
343
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
344 (defcustom gnus-read-mark ?R
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
345 "*Mark used for read articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
346 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
347 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
348
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
349 (defcustom gnus-expirable-mark ?E
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
350 "*Mark used for expirable articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
351 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
352 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
353
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
354 (defcustom gnus-killed-mark ?K
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
355 "*Mark used for killed articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
356 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
357 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
358
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
359 (defcustom gnus-souped-mark ?F
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
360 "*Mark used for killed articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
361 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
362 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
363
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
364 (defcustom gnus-kill-file-mark ?X
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
365 "*Mark used for articles killed by kill files."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
366 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
367 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
368
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
369 (defcustom gnus-low-score-mark ?Y
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
370 "*Mark used for articles with a low score."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
371 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
372 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
373
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
374 (defcustom gnus-catchup-mark ?C
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
375 "*Mark used for articles that are caught up."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
376 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
377 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
378
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
379 (defcustom gnus-replied-mark ?A
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
380 "*Mark used for articles that have been replied to."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
381 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
382 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
383
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
384 (defcustom gnus-cached-mark ?*
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
385 "*Mark used for articles that are in the cache."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
386 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
387 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
388
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
389 (defcustom gnus-saved-mark ?S
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
390 "*Mark used for articles that have been saved to."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
391 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
392 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
393
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
394 (defcustom gnus-ancient-mark ?O
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
395 "*Mark used for ancient articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
396 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
397 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
398
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
399 (defcustom gnus-sparse-mark ?Q
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
400 "*Mark used for sparsely reffed articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
401 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
402 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
403
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
404 (defcustom gnus-canceled-mark ?G
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
405 "*Mark used for canceled articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
406 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
407 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
408
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
409 (defcustom gnus-duplicate-mark ?M
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
410 "*Mark used for duplicate articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
411 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
412 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
413
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
414 (defcustom gnus-score-over-mark ?+
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
415 "*Score mark used for articles with high scores."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
416 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
417 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
418
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
419 (defcustom gnus-score-below-mark ?-
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
420 "*Score mark used for articles with low scores."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
421 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
422 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
423
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
424 (defcustom gnus-empty-thread-mark ?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
425 "*There is no thread under the article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
426 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
427 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
428
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
429 (defcustom gnus-not-empty-thread-mark ?=
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
430 "*There is a thread under the article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
431 :group 'gnus-summary-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
432 :type 'character)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
433
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
434 (defcustom gnus-view-pseudo-asynchronously nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
435 "*If non-nil, Gnus will view pseudo-articles asynchronously."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
436 :group 'gnus-extract-view
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
437 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
438
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
439 (defcustom gnus-view-pseudos nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
440 "*If `automatic', pseudo-articles will be viewed automatically.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
441 If `not-confirm', pseudos will be viewed automatically, and the user
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
442 will not be asked to confirm the command."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
443 :group 'gnus-extract-view
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
444 :type '(choice (const :tag "off" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
445 (const automatic)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
446 (const not-confirm)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
447
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
448 (defcustom gnus-view-pseudos-separately t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
449 "*If non-nil, one pseudo-article will be created for each file to be viewed.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
450 If nil, all files that use the same viewing command will be given as a
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
451 list of parameters to that command."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
452 :group 'gnus-extract-view
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
453 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
454
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
455 (defcustom gnus-insert-pseudo-articles t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
456 "*If non-nil, insert pseudo-articles when decoding articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
457 :group 'gnus-extract-view
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
458 :type 'boolean)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
459
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
460 (defcustom gnus-summary-dummy-line-format
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
461 "* %(: :%) %S\n"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
462 "*The format specification for the dummy roots in the summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
463 It works along the same lines as a normal formatting string,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
464 with some simple extensions.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
465
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
466 %S The subject"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
467 :group 'gnus-threading
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
468 :type 'string)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
469
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
470 (defcustom gnus-summary-mode-line-format "Gnus: %%b [%A] %Z"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
471 "*The format specification for the summary mode line.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
472 It works along the same lines as a normal formatting string,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
473 with some simple extensions:
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
474
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
475 %G Group name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
476 %p Unprefixed group name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
477 %A Current article number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
478 %V Gnus version
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
479 %U Number of unread articles in the group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
480 %e Number of unselected articles in the group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
481 %Z A string with unread/unselected article counts
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
482 %g Shortish group name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
483 %S Subject of the current article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
484 %u User-defined spec
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
485 %s Current score file name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
486 %d Number of dormant articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
487 %r Number of articles that have been marked as read in this session
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
488 %E Number of articles expunged by the score files"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
489 :group 'gnus-summary-format
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
490 :type 'string)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
491
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
492 (defcustom gnus-summary-mark-below 0
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
493 "*Mark all articles with a score below this variable as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
494 This variable is local to each summary buffer and usually set by the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
495 score file."
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
496 :group 'gnus-score-default
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
497 :type 'integer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
498
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
499 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
500 "*List of functions used for sorting articles in the summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
501 This variable is only used when not using a threaded display."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
502 :group 'gnus-summary-sort
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
503 :type '(repeat (choice (function-item gnus-article-sort-by-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
504 (function-item gnus-article-sort-by-author)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
505 (function-item gnus-article-sort-by-subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
506 (function-item gnus-article-sort-by-date)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
507 (function-item gnus-article-sort-by-score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
508 (function :tag "other"))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
509
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
510 (defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
511 "*List of functions used for sorting threads in the summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
512 By default, threads are sorted by article number.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
513
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
514 Each function takes two threads and return non-nil if the first thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
515 should be sorted before the other. If you use more than one function,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
516 the primary sort function should be the last. You should probably
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
517 always include `gnus-thread-sort-by-number' in the list of sorting
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
518 functions -- preferably first.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
519
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
520 Ready-made functions include `gnus-thread-sort-by-number',
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
521 `gnus-thread-sort-by-author', `gnus-thread-sort-by-subject',
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
522 `gnus-thread-sort-by-date', `gnus-thread-sort-by-score' and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
523 `gnus-thread-sort-by-total-score' (see `gnus-thread-score-function')."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
524 :group 'gnus-summary-sort
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
525 :type '(repeat (choice (function-item gnus-thread-sort-by-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
526 (function-item gnus-thread-sort-by-author)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
527 (function-item gnus-thread-sort-by-subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
528 (function-item gnus-thread-sort-by-date)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
529 (function-item gnus-thread-sort-by-score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
530 (function-item gnus-thread-sort-by-total-score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
531 (function :tag "other"))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
532
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
533 (defcustom gnus-thread-score-function '+
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
534 "*Function used for calculating the total score of a thread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
535
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
536 The function is called with the scores of the article and each
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
537 subthread and should then return the score of the thread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
538
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
539 Some functions you can use are `+', `max', or `min'."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
540 :group 'gnus-summary-sort
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
541 :type 'function)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
542
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
543 (defcustom gnus-summary-expunge-below nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
544 "All articles that have a score less than this variable will be expunged."
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
545 :group 'gnus-score-default
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
546 :type '(choice (const :tag "off" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
547 integer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
548
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
549 (defcustom gnus-thread-expunge-below nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
550 "All threads that have a total score less than this variable will be expunged.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
551 See `gnus-thread-score-function' for en explanation of what a
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
552 \"thread score\" is."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
553 :group 'gnus-treading
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
554 :group 'gnus-score-default
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
555 :type '(choice (const :tag "off" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
556 integer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
557
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
558 (defcustom gnus-summary-mode-hook nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
559 "*A hook for Gnus summary mode.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
560 This hook is run before any variables are set in the summary buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
561 :group 'gnus-summary-various
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
562 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
563
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
564 (defcustom gnus-summary-menu-hook nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
565 "*Hook run after the creation of the summary mode menu."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
566 :group 'gnus-summary-visual
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
567 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
568
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
569 (defcustom gnus-summary-exit-hook nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
570 "*A hook called on exit from the summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
571 It will be called with point in the group buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
572 :group 'gnus-summary-exit
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
573 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
574
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
575 (defcustom gnus-summary-prepare-hook nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
576 "*A hook called after the summary buffer has been generated.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
577 If you want to modify the summary buffer, you can use this hook."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
578 :group 'gnus-summary-various
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
579 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
580
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
581 (defcustom gnus-summary-generate-hook nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
582 "*A hook run just before generating the summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
583 This hook is commonly used to customize threading variables and the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
584 like."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
585 :group 'gnus-summary-various
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
586 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
587
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
588 (defcustom gnus-select-group-hook nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
589 "*A hook called when a newsgroup is selected.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
590
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
591 If you'd like to simplify subjects like the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
592 `gnus-summary-next-same-subject' command does, you can use the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
593 following hook:
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
594
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
595 (setq gnus-select-group-hook
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
596 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
597 (lambda ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
598 (mapcar (lambda (header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
599 (mail-header-set-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
600 header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
601 (gnus-simplify-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
602 (mail-header-subject header) 're-only)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
603 gnus-newsgroup-headers))))"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
604 :group 'gnus-group-select
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
605 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
606
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
607 (defcustom gnus-select-article-hook nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
608 "*A hook called when an article is selected."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
609 :group 'gnus-summary-choose
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
610 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
611
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
612 (defcustom gnus-visual-mark-article-hook
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
613 (list 'gnus-highlight-selected-summary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
614 "*Hook run after selecting an article in the summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
615 It is meant to be used for highlighting the article in some way. It
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
616 is not run if `gnus-visual' is nil."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
617 :group 'gnus-summary-visual
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
618 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
619
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
620 (defcustom gnus-parse-headers-hook
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
621 (list 'gnus-decode-rfc1522)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
622 "*A hook called before parsing the headers."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
623 :group 'gnus-various
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
624 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
625
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
626 (defcustom gnus-exit-group-hook nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
627 "*A hook called when exiting (not quitting) summary mode."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
628 :group 'gnus-various
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
629 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
630
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
631 (defcustom gnus-summary-update-hook
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
632 (list 'gnus-summary-highlight-line)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
633 "*A hook called when a summary line is changed.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
634 The hook will not be called if `gnus-visual' is nil.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
635
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
636 The default function `gnus-summary-highlight-line' will
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
637 highlight the line according to the `gnus-summary-highlight'
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
638 variable."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
639 :group 'gnus-summary-visual
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
640 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
641
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
642 (defcustom gnus-mark-article-hook '(gnus-summary-mark-read-and-unread-as-read)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
643 "*A hook called when an article is selected for the first time.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
644 The hook is intended to mark an article as read (or unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
645 automatically when it is selected."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
646 :group 'gnus-summary-choose
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
647 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
648
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
649 (defcustom gnus-group-no-more-groups-hook nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
650 "*A hook run when returning to group mode having no more (unread) groups."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
651 :group 'gnus-group-select
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
652 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
653
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
654 (defcustom gnus-ps-print-hook nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
655 "*A hook run before ps-printing something from Gnus."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
656 :group 'gnus-summary
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
657 :type 'hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
658
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
659 (defcustom gnus-summary-selected-face 'gnus-summary-selected-face
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
660 "Face used for highlighting the current article in the summary buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
661 :group 'gnus-summary-visual
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
662 :type 'face)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
663
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
664 (defcustom gnus-summary-highlight
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
665 '(((= mark gnus-canceled-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
666 . gnus-summary-cancelled-face)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
667 ((and (> score default)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
668 (or (= mark gnus-dormant-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
669 (= mark gnus-ticked-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
670 . gnus-summary-high-ticked-face)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
671 ((and (< score default)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
672 (or (= mark gnus-dormant-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
673 (= mark gnus-ticked-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
674 . gnus-summary-low-ticked-face)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
675 ((or (= mark gnus-dormant-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
676 (= mark gnus-ticked-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
677 . gnus-summary-normal-ticked-face)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
678 ((and (> score default) (= mark gnus-ancient-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
679 . gnus-summary-high-ancient-face)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
680 ((and (< score default) (= mark gnus-ancient-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
681 . gnus-summary-low-ancient-face)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
682 ((= mark gnus-ancient-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
683 . gnus-summary-normal-ancient-face)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
684 ((and (> score default) (= mark gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
685 . gnus-summary-high-unread-face)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
686 ((and (< score default) (= mark gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
687 . gnus-summary-low-unread-face)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
688 ((and (= mark gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
689 . gnus-summary-normal-unread-face)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
690 ((> score default)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
691 . gnus-summary-high-read-face)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
692 ((< score default)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
693 . gnus-summary-low-read-face)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
694 (t
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
695 . gnus-summary-normal-read-face))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
696 "Controls the highlighting of summary buffer lines.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
697
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
698 A list of (FORM . FACE) pairs. When deciding how a a particular
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
699 summary line should be displayed, each form is evaluated. The content
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
700 of the face field after the first true form is used. You can change
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
701 how those summary lines are displayed, by editing the face field.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
702
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
703 You can use the following variables in the FORM field.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
704
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
705 score: The articles score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
706 default: The default article score.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
707 below: The score below which articles are automatically marked as read.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
708 mark: The articles mark."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
709 :group 'gnus-summary-visual
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
710 :type '(repeat (cons (sexp :tag "Form" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
711 face)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
712
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
713
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
714 ;;; Internal variables
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
715
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
716 (defvar gnus-scores-exclude-files nil)
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
717 (defvar gnus-page-broken nil)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
718
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
719 (defvar gnus-original-article nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
720 (defvar gnus-article-internal-prepare-hook nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
721 (defvar gnus-newsgroup-process-stack nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
722
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
723 (defvar gnus-thread-indent-array nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
724 (defvar gnus-thread-indent-array-level gnus-thread-indent-level)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
725
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
726 ;; Avoid highlighting in kill files.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
727 (defvar gnus-summary-inhibit-highlight nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
728 (defvar gnus-newsgroup-selected-overlay nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
729 (defvar gnus-inhibit-limiting nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
730 (defvar gnus-newsgroup-adaptive-score-file nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
731 (defvar gnus-current-score-file nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
732 (defvar gnus-current-move-group nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
733 (defvar gnus-current-copy-group nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
734 (defvar gnus-current-crosspost-group nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
735
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
736 (defvar gnus-newsgroup-dependencies nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
737 (defvar gnus-newsgroup-adaptive nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
738 (defvar gnus-summary-display-article-function nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
739 (defvar gnus-summary-highlight-line-function nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
740 "Function called after highlighting a summary line.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
741
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
742 (defvar gnus-summary-line-format-alist
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
743 `((?N ,(macroexpand '(mail-header-number gnus-tmp-header)) ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
744 (?S ,(macroexpand '(mail-header-subject gnus-tmp-header)) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
745 (?s gnus-tmp-subject-or-nil ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
746 (?n gnus-tmp-name ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
747 (?A (car (cdr (funcall gnus-extract-address-components gnus-tmp-from)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
748 ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
749 (?a (or (car (funcall gnus-extract-address-components gnus-tmp-from))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
750 gnus-tmp-from) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
751 (?F gnus-tmp-from ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
752 (?x ,(macroexpand '(mail-header-xref gnus-tmp-header)) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
753 (?D ,(macroexpand '(mail-header-date gnus-tmp-header)) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
754 (?d (gnus-dd-mmm (mail-header-date gnus-tmp-header)) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
755 (?o (gnus-date-iso8601 gnus-tmp-header) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
756 (?M ,(macroexpand '(mail-header-id gnus-tmp-header)) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
757 (?r ,(macroexpand '(mail-header-references gnus-tmp-header)) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
758 (?c (or (mail-header-chars gnus-tmp-header) 0) ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
759 (?L gnus-tmp-lines ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
760 (?I gnus-tmp-indentation ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
761 (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
762 (?R gnus-tmp-replied ?c)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
763 (?\[ gnus-tmp-opening-bracket ?c)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
764 (?\] gnus-tmp-closing-bracket ?c)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
765 (?\> (make-string gnus-tmp-level ? ) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
766 (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
767 (?i gnus-tmp-score ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
768 (?z gnus-tmp-score-char ?c)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
769 (?l (bbb-grouplens-score gnus-tmp-header) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
770 (?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
771 (?U gnus-tmp-unread ?c)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
772 (?t (gnus-summary-number-of-articles-in-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
773 (and (boundp 'thread) (car thread)) gnus-tmp-level)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
774 ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
775 (?e (gnus-summary-number-of-articles-in-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
776 (and (boundp 'thread) (car thread)) gnus-tmp-level t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
777 ?c)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
778 (?u gnus-tmp-user-defined ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
779 (?P (gnus-pick-line-number) ?d))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
780 "An alist of format specifications that can appear in summary lines,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
781 and what variables they correspond with, along with the type of the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
782 variable (string, integer, character, etc).")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
783
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
784 (defvar gnus-summary-dummy-line-format-alist
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
785 `((?S gnus-tmp-subject ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
786 (?N gnus-tmp-number ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
787 (?u gnus-tmp-user-defined ?s)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
788
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
789 (defvar gnus-summary-mode-line-format-alist
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
790 `((?G gnus-tmp-group-name ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
791 (?g (gnus-short-group-name gnus-tmp-group-name) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
792 (?p (gnus-group-real-name gnus-tmp-group-name) ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
793 (?A gnus-tmp-article-number ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
794 (?Z gnus-tmp-unread-and-unselected ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
795 (?V gnus-version ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
796 (?U gnus-tmp-unread-and-unticked ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
797 (?S gnus-tmp-subject ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
798 (?e gnus-tmp-unselected ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
799 (?u gnus-tmp-user-defined ?s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
800 (?d (length gnus-newsgroup-dormant) ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
801 (?t (length gnus-newsgroup-marked) ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
802 (?r (length gnus-newsgroup-reads) ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
803 (?E gnus-newsgroup-expunged-tally ?d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
804 (?s (gnus-current-score-file-nondirectory) ?s)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
805
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
806 (defvar gnus-last-search-regexp nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
807 "Default regexp for article search command.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
808
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
809 (defvar gnus-last-shell-command nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
810 "Default shell command on article.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
811
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
812 (defvar gnus-newsgroup-begin nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
813 (defvar gnus-newsgroup-end nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
814 (defvar gnus-newsgroup-last-rmail nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
815 (defvar gnus-newsgroup-last-mail nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
816 (defvar gnus-newsgroup-last-folder nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
817 (defvar gnus-newsgroup-last-file nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
818 (defvar gnus-newsgroup-auto-expire nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
819 (defvar gnus-newsgroup-active nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
820
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
821 (defvar gnus-newsgroup-data nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
822 (defvar gnus-newsgroup-data-reverse nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
823 (defvar gnus-newsgroup-limit nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
824 (defvar gnus-newsgroup-limits nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
825
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
826 (defvar gnus-newsgroup-unreads nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
827 "List of unread articles in the current newsgroup.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
828
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
829 (defvar gnus-newsgroup-unselected nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
830 "List of unselected unread articles in the current newsgroup.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
831
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
832 (defvar gnus-newsgroup-reads nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
833 "Alist of read articles and article marks in the current newsgroup.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
834
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
835 (defvar gnus-newsgroup-expunged-tally nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
836
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
837 (defvar gnus-newsgroup-marked nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
838 "List of ticked articles in the current newsgroup (a subset of unread art).")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
839
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
840 (defvar gnus-newsgroup-killed nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
841 "List of ranges of articles that have been through the scoring process.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
842
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
843 (defvar gnus-newsgroup-cached nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
844 "List of articles that come from the article cache.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
845
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
846 (defvar gnus-newsgroup-saved nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
847 "List of articles that have been saved.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
848
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
849 (defvar gnus-newsgroup-kill-headers nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
850
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
851 (defvar gnus-newsgroup-replied nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
852 "List of articles that have been replied to in the current newsgroup.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
853
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
854 (defvar gnus-newsgroup-expirable nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
855 "List of articles in the current newsgroup that can be expired.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
856
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
857 (defvar gnus-newsgroup-processable nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
858 "List of articles in the current newsgroup that can be processed.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
859
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
860 (defvar gnus-newsgroup-bookmarks nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
861 "List of articles in the current newsgroup that have bookmarks.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
862
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
863 (defvar gnus-newsgroup-dormant nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
864 "List of dormant articles in the current newsgroup.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
865
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
866 (defvar gnus-newsgroup-scored nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
867 "List of scored articles in the current newsgroup.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
868
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
869 (defvar gnus-newsgroup-headers nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
870 "List of article headers in the current newsgroup.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
871
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
872 (defvar gnus-newsgroup-threads nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
873
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
874 (defvar gnus-newsgroup-prepared nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
875 "Whether the current group has been prepared properly.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
876
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
877 (defvar gnus-newsgroup-ancient nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
878 "List of `gnus-fetch-old-headers' articles in the current newsgroup.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
879
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
880 (defvar gnus-newsgroup-sparse nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
881
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
882 (defvar gnus-current-article nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
883 (defvar gnus-article-current nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
884 (defvar gnus-current-headers nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
885 (defvar gnus-have-all-headers nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
886 (defvar gnus-last-article nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
887 (defvar gnus-newsgroup-history nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
888
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
889 (defconst gnus-summary-local-variables
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
890 '(gnus-newsgroup-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
891 gnus-newsgroup-begin gnus-newsgroup-end
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
892 gnus-newsgroup-last-rmail gnus-newsgroup-last-mail
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
893 gnus-newsgroup-last-folder gnus-newsgroup-last-file
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
894 gnus-newsgroup-auto-expire gnus-newsgroup-unreads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
895 gnus-newsgroup-unselected gnus-newsgroup-marked
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
896 gnus-newsgroup-reads gnus-newsgroup-saved
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
897 gnus-newsgroup-replied gnus-newsgroup-expirable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
898 gnus-newsgroup-processable gnus-newsgroup-killed
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
899 gnus-newsgroup-bookmarks gnus-newsgroup-dormant
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
900 gnus-newsgroup-headers gnus-newsgroup-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
901 gnus-newsgroup-prepared gnus-summary-highlight-line-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
902 gnus-current-article gnus-current-headers gnus-have-all-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
903 gnus-last-article gnus-article-internal-prepare-hook
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
904 gnus-newsgroup-dependencies gnus-newsgroup-selected-overlay
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
905 gnus-newsgroup-scored gnus-newsgroup-kill-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
906 gnus-thread-expunge-below
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
907 gnus-score-alist gnus-current-score-file gnus-summary-expunge-below
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
908 (gnus-summary-mark-below . global)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
909 gnus-newsgroup-active gnus-scores-exclude-files
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
910 gnus-newsgroup-history gnus-newsgroup-ancient
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
911 gnus-newsgroup-sparse gnus-newsgroup-process-stack
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
912 (gnus-newsgroup-adaptive . gnus-use-adaptive-scoring)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
913 gnus-newsgroup-adaptive-score-file (gnus-reffed-article-number . -1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
914 (gnus-newsgroup-expunged-tally . 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
915 gnus-cache-removable-articles gnus-newsgroup-cached
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
916 gnus-newsgroup-data gnus-newsgroup-data-reverse
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
917 gnus-newsgroup-limit gnus-newsgroup-limits)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
918 "Variables that are buffer-local to the summary buffers.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
919
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
920 ;; Byte-compiler warning.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
921 (defvar gnus-article-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
922
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
923 ;; Subject simplification.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
924
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
925 (defsubst gnus-simplify-subject-re (subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
926 "Remove \"Re:\" from subject lines."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
927 (if (string-match "^[Rr][Ee]: *" subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
928 (substring subject (match-end 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
929 subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
930
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
931 (defun gnus-simplify-subject (subject &optional re-only)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
932 "Remove `Re:' and words in parentheses.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
933 If RE-ONLY is non-nil, strip leading `Re:'s only."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
934 (let ((case-fold-search t)) ;Ignore case.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
935 ;; Remove `Re:', `Re^N:', `Re(n)', and `Re[n]:'.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
936 (when (string-match "\\`\\(re\\([[(^][0-9]+[])]?\\)?:[ \t]*\\)+" subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
937 (setq subject (substring subject (match-end 0))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
938 ;; Remove uninteresting prefixes.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
939 (when (and (not re-only)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
940 gnus-simplify-ignored-prefixes
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
941 (string-match gnus-simplify-ignored-prefixes subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
942 (setq subject (substring subject (match-end 0))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
943 ;; Remove words in parentheses from end.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
944 (unless re-only
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
945 (while (string-match "[ \t\n]*([^()]*)[ \t\n]*\\'" subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
946 (setq subject (substring subject 0 (match-beginning 0)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
947 ;; Return subject string.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
948 subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
949
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
950 ;; Remove any leading "re:"s, any trailing paren phrases, and simplify
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
951 ;; all whitespace.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
952 (defsubst gnus-simplify-buffer-fuzzy-step (regexp &optional newtext)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
953 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
954 (while (re-search-forward regexp nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
955 (replace-match (or newtext ""))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
956
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
957 (defun gnus-simplify-buffer-fuzzy ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
958 "Simplify string in the buffer fuzzily.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
959 The string in the accessible portion of the current buffer is simplified.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
960 It is assumed to be a single-line subject.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
961 Whitespace is generally cleaned up, and miscellaneous leading/trailing
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
962 matter is removed. Additional things can be deleted by setting
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
963 gnus-simplify-subject-fuzzy-regexp."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
964 (let ((case-fold-search t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
965 (modified-tick))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
966 (gnus-simplify-buffer-fuzzy-step "\t" " ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
967
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
968 (while (not (eq modified-tick (buffer-modified-tick)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
969 (setq modified-tick (buffer-modified-tick))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
970 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
971 ((listp gnus-simplify-subject-fuzzy-regexp)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
972 (mapcar 'gnus-simplify-buffer-fuzzy-step
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
973 gnus-simplify-subject-fuzzy-regexp))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
974 (gnus-simplify-subject-fuzzy-regexp
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
975 (gnus-simplify-buffer-fuzzy-step gnus-simplify-subject-fuzzy-regexp)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
976 (gnus-simplify-buffer-fuzzy-step "^ *\\[[-+?*!][-+?*!]\\] *")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
977 (gnus-simplify-buffer-fuzzy-step
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
978 "^ *\\(re\\|fw\\|fwd\\)[[{(^0-9]*[])}]?[:;] *")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
979 (gnus-simplify-buffer-fuzzy-step "^[[].*:\\( .*\\)[]]$" "\\1"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
980
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
981 (gnus-simplify-buffer-fuzzy-step " *[[{(][^()\n]*[]})] *$")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
982 (gnus-simplify-buffer-fuzzy-step " +" " ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
983 (gnus-simplify-buffer-fuzzy-step " $")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
984 (gnus-simplify-buffer-fuzzy-step "^ +")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
985
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
986 (defun gnus-simplify-subject-fuzzy (subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
987 "Simplify a subject string fuzzily.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
988 See gnus-simplify-buffer-fuzzy for details."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
989 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
990 (gnus-set-work-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
991 (let ((case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
992 (insert subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
993 (inline (gnus-simplify-buffer-fuzzy))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
994 (buffer-string))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
995
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
996 (defsubst gnus-simplify-subject-fully (subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
997 "Simplify a subject string according to gnus-summary-gather-subject-limit."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
998 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
999 ((null gnus-summary-gather-subject-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1000 (gnus-simplify-subject-re subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1001 ((eq gnus-summary-gather-subject-limit 'fuzzy)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1002 (gnus-simplify-subject-fuzzy subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1003 ((numberp gnus-summary-gather-subject-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1004 (gnus-limit-string (gnus-simplify-subject-re subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1005 gnus-summary-gather-subject-limit))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1006 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1007 subject)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1008
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1009 (defsubst gnus-subject-equal (s1 s2 &optional simple-first)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1010 "Check whether two subjects are equal. If optional argument
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1011 simple-first is t, first argument is already simplified."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1012 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1013 ((null simple-first)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1014 (equal (gnus-simplify-subject-fully s1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1015 (gnus-simplify-subject-fully s2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1016 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1017 (equal s1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1018 (gnus-simplify-subject-fully s2)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1019
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1020 (defun gnus-summary-bubble-group ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1021 "Increase the score of the current group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1022 This is a handy function to add to `gnus-summary-exit-hook' to
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1023 increase the score of each group you read."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1024 (gnus-group-add-score gnus-newsgroup-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1025
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1026
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1027 ;;;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1028 ;;; Gnus summary mode
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1029 ;;;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1030
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1031 (put 'gnus-summary-mode 'mode-class 'special)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1032
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1033 (when t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1034 ;; Non-orthogonal keys
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1035
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1036 (gnus-define-keys gnus-summary-mode-map
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1037 " " gnus-summary-next-page
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1038 "\177" gnus-summary-prev-page
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1039 [delete] gnus-summary-prev-page
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1040 "\r" gnus-summary-scroll-up
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1041 "n" gnus-summary-next-unread-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1042 "p" gnus-summary-prev-unread-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1043 "N" gnus-summary-next-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1044 "P" gnus-summary-prev-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1045 "\M-\C-n" gnus-summary-next-same-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1046 "\M-\C-p" gnus-summary-prev-same-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1047 "\M-n" gnus-summary-next-unread-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1048 "\M-p" gnus-summary-prev-unread-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1049 "." gnus-summary-first-unread-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1050 "," gnus-summary-best-unread-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1051 "\M-s" gnus-summary-search-article-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1052 "\M-r" gnus-summary-search-article-backward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1053 "<" gnus-summary-beginning-of-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1054 ">" gnus-summary-end-of-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1055 "j" gnus-summary-goto-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1056 "^" gnus-summary-refer-parent-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1057 "\M-^" gnus-summary-refer-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1058 "u" gnus-summary-tick-article-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1059 "!" gnus-summary-tick-article-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1060 "U" gnus-summary-tick-article-backward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1061 "d" gnus-summary-mark-as-read-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1062 "D" gnus-summary-mark-as-read-backward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1063 "E" gnus-summary-mark-as-expirable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1064 "\M-u" gnus-summary-clear-mark-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1065 "\M-U" gnus-summary-clear-mark-backward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1066 "k" gnus-summary-kill-same-subject-and-select
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1067 "\C-k" gnus-summary-kill-same-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1068 "\M-\C-k" gnus-summary-kill-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1069 "\M-\C-l" gnus-summary-lower-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1070 "e" gnus-summary-edit-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1071 "#" gnus-summary-mark-as-processable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1072 "\M-#" gnus-summary-unmark-as-processable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1073 "\M-\C-t" gnus-summary-toggle-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1074 "\M-\C-s" gnus-summary-show-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1075 "\M-\C-h" gnus-summary-hide-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1076 "\M-\C-f" gnus-summary-next-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1077 "\M-\C-b" gnus-summary-prev-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1078 "\M-\C-u" gnus-summary-up-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1079 "\M-\C-d" gnus-summary-down-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1080 "&" gnus-summary-execute-command
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1081 "c" gnus-summary-catchup-and-exit
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1082 "\C-w" gnus-summary-mark-region-as-read
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1083 "\C-t" gnus-summary-toggle-truncation
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1084 "?" gnus-summary-mark-as-dormant
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1085 "\C-c\M-\C-s" gnus-summary-limit-include-expunged
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1086 "\C-c\C-s\C-n" gnus-summary-sort-by-number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1087 "\C-c\C-s\C-l" gnus-summary-sort-by-lines
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1088 "\C-c\C-s\C-a" gnus-summary-sort-by-author
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1089 "\C-c\C-s\C-s" gnus-summary-sort-by-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1090 "\C-c\C-s\C-d" gnus-summary-sort-by-date
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1091 "\C-c\C-s\C-i" gnus-summary-sort-by-score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1092 "=" gnus-summary-expand-window
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1093 "\C-x\C-s" gnus-summary-reselect-current-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1094 "\M-g" gnus-summary-rescan-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1095 "w" gnus-summary-stop-page-breaking
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1096 "\C-c\C-r" gnus-summary-caesar-message
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1097 "\M-t" gnus-summary-toggle-mime
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1098 "f" gnus-summary-followup
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1099 "F" gnus-summary-followup-with-original
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1100 "C" gnus-summary-cancel-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1101 "r" gnus-summary-reply
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1102 "R" gnus-summary-reply-with-original
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1103 "\C-c\C-f" gnus-summary-mail-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1104 "o" gnus-summary-save-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1105 "\C-o" gnus-summary-save-article-mail
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1106 "|" gnus-summary-pipe-output
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1107 "\M-k" gnus-summary-edit-local-kill
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1108 "\M-K" gnus-summary-edit-global-kill
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1109 ;; "V" gnus-version
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1110 "\C-c\C-d" gnus-summary-describe-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1111 "q" gnus-summary-exit
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1112 "Q" gnus-summary-exit-no-update
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1113 "\C-c\C-i" gnus-info-find-node
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1114 gnus-mouse-2 gnus-mouse-pick-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1115 "m" gnus-summary-mail-other-window
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1116 "a" gnus-summary-post-news
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1117 "x" gnus-summary-limit-to-unread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1118 "s" gnus-summary-isearch-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1119 "t" gnus-article-hide-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1120 "g" gnus-summary-show-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1121 "l" gnus-summary-goto-last-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1122 "\C-c\C-v\C-v" gnus-uu-decode-uu-view
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1123 "\C-d" gnus-summary-enter-digest-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1124 "\M-\C-d" gnus-summary-read-document
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1125 "\C-c\C-b" gnus-bug
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1126 "*" gnus-cache-enter-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1127 "\M-*" gnus-cache-remove-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1128 "\M-&" gnus-summary-universal-argument
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1129 "\C-l" gnus-recenter
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1130 "I" gnus-summary-increase-score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1131 "L" gnus-summary-lower-score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1132
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1133 "V" gnus-summary-score-map
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1134 "X" gnus-uu-extract-map
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1135 "S" gnus-summary-send-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1136
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1137 ;; Sort of orthogonal keymap
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1138 (gnus-define-keys (gnus-summary-mark-map "M" gnus-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1139 "t" gnus-summary-tick-article-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1140 "!" gnus-summary-tick-article-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1141 "d" gnus-summary-mark-as-read-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1142 "r" gnus-summary-mark-as-read-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1143 "c" gnus-summary-clear-mark-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1144 " " gnus-summary-clear-mark-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1145 "e" gnus-summary-mark-as-expirable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1146 "x" gnus-summary-mark-as-expirable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1147 "?" gnus-summary-mark-as-dormant
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1148 "b" gnus-summary-set-bookmark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1149 "B" gnus-summary-remove-bookmark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1150 "#" gnus-summary-mark-as-processable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1151 "\M-#" gnus-summary-unmark-as-processable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1152 "S" gnus-summary-limit-include-expunged
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1153 "C" gnus-summary-catchup
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1154 "H" gnus-summary-catchup-to-here
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1155 "\C-c" gnus-summary-catchup-all
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1156 "k" gnus-summary-kill-same-subject-and-select
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1157 "K" gnus-summary-kill-same-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1158 "P" gnus-uu-mark-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1159
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1160 (gnus-define-keys (gnus-summary-mscore-map "V" gnus-summary-mark-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1161 "c" gnus-summary-clear-above
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1162 "u" gnus-summary-tick-above
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1163 "m" gnus-summary-mark-above
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1164 "k" gnus-summary-kill-below)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1165
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1166 (gnus-define-keys (gnus-summary-limit-map "/" gnus-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1167 "/" gnus-summary-limit-to-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1168 "n" gnus-summary-limit-to-articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1169 "w" gnus-summary-pop-limit
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1170 "s" gnus-summary-limit-to-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1171 "a" gnus-summary-limit-to-author
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1172 "u" gnus-summary-limit-to-unread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1173 "m" gnus-summary-limit-to-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1174 "v" gnus-summary-limit-to-score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1175 "D" gnus-summary-limit-include-dormant
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1176 "d" gnus-summary-limit-exclude-dormant
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1177 "t" gnus-summary-limit-to-age
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1178 "E" gnus-summary-limit-include-expunged
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1179 "c" gnus-summary-limit-exclude-childless-dormant
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1180 "C" gnus-summary-limit-mark-excluded-as-read)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1181
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1182 (gnus-define-keys (gnus-summary-goto-map "G" gnus-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1183 "n" gnus-summary-next-unread-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1184 "p" gnus-summary-prev-unread-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1185 "N" gnus-summary-next-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1186 "P" gnus-summary-prev-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1187 "\C-n" gnus-summary-next-same-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1188 "\C-p" gnus-summary-prev-same-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1189 "\M-n" gnus-summary-next-unread-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1190 "\M-p" gnus-summary-prev-unread-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1191 "f" gnus-summary-first-unread-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1192 "b" gnus-summary-best-unread-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1193 "j" gnus-summary-goto-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1194 "g" gnus-summary-goto-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1195 "l" gnus-summary-goto-last-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1196 "p" gnus-summary-pop-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1197
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1198 (gnus-define-keys (gnus-summary-thread-map "T" gnus-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1199 "k" gnus-summary-kill-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1200 "l" gnus-summary-lower-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1201 "i" gnus-summary-raise-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1202 "T" gnus-summary-toggle-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1203 "t" gnus-summary-rethread-current
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1204 "^" gnus-summary-reparent-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1205 "s" gnus-summary-show-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1206 "S" gnus-summary-show-all-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1207 "h" gnus-summary-hide-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1208 "H" gnus-summary-hide-all-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1209 "n" gnus-summary-next-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1210 "p" gnus-summary-prev-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1211 "u" gnus-summary-up-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1212 "o" gnus-summary-top-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1213 "d" gnus-summary-down-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1214 "#" gnus-uu-mark-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1215 "\M-#" gnus-uu-unmark-thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1216
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1217 (gnus-define-keys (gnus-summary-buffer-map "Y" gnus-summary-mode-map)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1218 "g" gnus-summary-prepare
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1219 "c" gnus-summary-insert-cached-articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1220
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1221 (gnus-define-keys (gnus-summary-exit-map "Z" gnus-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1222 "c" gnus-summary-catchup-and-exit
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1223 "C" gnus-summary-catchup-all-and-exit
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1224 "E" gnus-summary-exit-no-update
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1225 "Q" gnus-summary-exit
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1226 "Z" gnus-summary-exit
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1227 "n" gnus-summary-catchup-and-goto-next-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1228 "R" gnus-summary-reselect-current-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1229 "G" gnus-summary-rescan-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1230 "N" gnus-summary-next-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1231 "s" gnus-summary-save-newsrc
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1232 "P" gnus-summary-prev-group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1233
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1234 (gnus-define-keys (gnus-summary-article-map "A" gnus-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1235 " " gnus-summary-next-page
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1236 "n" gnus-summary-next-page
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1237 "\177" gnus-summary-prev-page
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1238 [delete] gnus-summary-prev-page
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1239 "p" gnus-summary-prev-page
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1240 "\r" gnus-summary-scroll-up
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1241 "<" gnus-summary-beginning-of-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1242 ">" gnus-summary-end-of-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1243 "b" gnus-summary-beginning-of-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1244 "e" gnus-summary-end-of-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1245 "^" gnus-summary-refer-parent-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1246 "r" gnus-summary-refer-parent-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1247 "R" gnus-summary-refer-references
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1248 "g" gnus-summary-show-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1249 "s" gnus-summary-isearch-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1250 "P" gnus-summary-print-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1251
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1252 (gnus-define-keys (gnus-summary-wash-map "W" gnus-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1253 "b" gnus-article-add-buttons
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1254 "B" gnus-article-add-buttons-to-head
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1255 "o" gnus-article-treat-overstrike
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1256 "e" gnus-article-emphasize
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1257 "w" gnus-article-fill-cited-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1258 "c" gnus-article-remove-cr
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1259 "q" gnus-article-de-quoted-unreadable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1260 "f" gnus-article-display-x-face
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1261 "l" gnus-summary-stop-page-breaking
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1262 "r" gnus-summary-caesar-message
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1263 "t" gnus-article-hide-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1264 "v" gnus-summary-verbose-headers
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
1265 "m" gnus-summary-toggle-mime
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
1266 "h" gnus-article-treat-html)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1267
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1268 (gnus-define-keys (gnus-summary-wash-hide-map "W" gnus-summary-wash-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1269 "a" gnus-article-hide
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1270 "h" gnus-article-hide-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1271 "b" gnus-article-hide-boring-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1272 "s" gnus-article-hide-signature
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1273 "c" gnus-article-hide-citation
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1274 "p" gnus-article-hide-pgp
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1275 "P" gnus-article-hide-pem
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1276 "\C-c" gnus-article-hide-citation-maybe)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1277
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1278 (gnus-define-keys (gnus-summary-wash-highlight-map "H" gnus-summary-wash-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1279 "a" gnus-article-highlight
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1280 "h" gnus-article-highlight-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1281 "c" gnus-article-highlight-citation
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1282 "s" gnus-article-highlight-signature)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1283
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1284 (gnus-define-keys (gnus-summary-wash-time-map "T" gnus-summary-wash-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1285 "z" gnus-article-date-ut
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1286 "u" gnus-article-date-ut
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1287 "l" gnus-article-date-local
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1288 "e" gnus-article-date-lapsed
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1289 "o" gnus-article-date-original
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1290 "s" gnus-article-date-user)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1291
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1292 (gnus-define-keys (gnus-summary-wash-empty-map "E" gnus-summary-wash-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1293 "t" gnus-article-remove-trailing-blank-lines
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1294 "l" gnus-article-strip-leading-blank-lines
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1295 "m" gnus-article-strip-multiple-blank-lines
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
1296 "a" gnus-article-strip-blank-lines
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
1297 "s" gnus-article-strip-leading-space)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1298
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1299 (gnus-define-keys (gnus-summary-help-map "H" gnus-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1300 "v" gnus-version
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1301 "f" gnus-summary-fetch-faq
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1302 "d" gnus-summary-describe-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1303 "h" gnus-summary-describe-briefly
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1304 "i" gnus-info-find-node)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1305
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1306 (gnus-define-keys (gnus-summary-backend-map "B" gnus-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1307 "e" gnus-summary-expire-articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1308 "\M-\C-e" gnus-summary-expire-articles-now
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1309 "\177" gnus-summary-delete-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1310 [delete] gnus-summary-delete-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1311 "m" gnus-summary-move-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1312 "r" gnus-summary-respool-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1313 "w" gnus-summary-edit-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1314 "c" gnus-summary-copy-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1315 "B" gnus-summary-crosspost-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1316 "q" gnus-summary-respool-query
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1317 "i" gnus-summary-import-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1318 "p" gnus-summary-article-posted-p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1319
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1320 (gnus-define-keys (gnus-summary-save-map "O" gnus-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1321 "o" gnus-summary-save-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1322 "m" gnus-summary-save-article-mail
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1323 "F" gnus-summary-write-article-file
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1324 "r" gnus-summary-save-article-rmail
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1325 "f" gnus-summary-save-article-file
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1326 "b" gnus-summary-save-article-body-file
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1327 "h" gnus-summary-save-article-folder
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1328 "v" gnus-summary-save-article-vm
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1329 "p" gnus-summary-pipe-output
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1330 "s" gnus-soup-add-article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1331
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1332 (defun gnus-summary-make-menu-bar ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1333 (gnus-turn-off-edit-menu 'summary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1334
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1335 (unless (boundp 'gnus-summary-misc-menu)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1336
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1337 (easy-menu-define
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1338 gnus-summary-kill-menu gnus-summary-mode-map ""
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1339 (cons
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1340 "Score"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1341 (nconc
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1342 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1343 ["Enter score..." gnus-summary-score-entry t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1344 ["Customize" gnus-score-customize t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1345 (gnus-make-score-map 'increase)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1346 (gnus-make-score-map 'lower)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1347 '(("Mark"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1348 ["Kill below" gnus-summary-kill-below t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1349 ["Mark above" gnus-summary-mark-above t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1350 ["Tick above" gnus-summary-tick-above t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1351 ["Clear above" gnus-summary-clear-above t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1352 ["Current score" gnus-summary-current-score t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1353 ["Set score" gnus-summary-set-score t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1354 ["Switch current score file..." gnus-score-change-score-file t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1355 ["Set mark below..." gnus-score-set-mark-below t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1356 ["Set expunge below..." gnus-score-set-expunge-below t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1357 ["Edit current score file" gnus-score-edit-current-scores t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1358 ["Edit score file" gnus-score-edit-file t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1359 ["Trace score" gnus-score-find-trace t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1360 ["Find words" gnus-score-find-favourite-words t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1361 ["Rescore buffer" gnus-summary-rescore t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1362 ["Increase score..." gnus-summary-increase-score t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1363 ["Lower score..." gnus-summary-lower-score t]))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1364
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1365 '(("Default header"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1366 ["Ask" (gnus-score-set-default 'gnus-score-default-header nil)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1367 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1368 :selected (null gnus-score-default-header)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1369 ["From" (gnus-score-set-default 'gnus-score-default-header 'a)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1370 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1371 :selected (eq gnus-score-default-header 'a)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1372 ["Subject" (gnus-score-set-default 'gnus-score-default-header 's)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1373 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1374 :selected (eq gnus-score-default-header 's)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1375 ["Article body"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1376 (gnus-score-set-default 'gnus-score-default-header 'b)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1377 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1378 :selected (eq gnus-score-default-header 'b )]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1379 ["All headers"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1380 (gnus-score-set-default 'gnus-score-default-header 'h)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1381 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1382 :selected (eq gnus-score-default-header 'h )]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1383 ["Message-ID" (gnus-score-set-default 'gnus-score-default-header 'i)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1384 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1385 :selected (eq gnus-score-default-header 'i )]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1386 ["Thread" (gnus-score-set-default 'gnus-score-default-header 't)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1387 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1388 :selected (eq gnus-score-default-header 't )]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1389 ["Crossposting"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1390 (gnus-score-set-default 'gnus-score-default-header 'x)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1391 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1392 :selected (eq gnus-score-default-header 'x )]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1393 ["Lines" (gnus-score-set-default 'gnus-score-default-header 'l)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1394 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1395 :selected (eq gnus-score-default-header 'l )]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1396 ["Date" (gnus-score-set-default 'gnus-score-default-header 'd)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1397 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1398 :selected (eq gnus-score-default-header 'd )]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1399 ["Followups to author"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1400 (gnus-score-set-default 'gnus-score-default-header 'f)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1401 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1402 :selected (eq gnus-score-default-header 'f )])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1403 ("Default type"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1404 ["Ask" (gnus-score-set-default 'gnus-score-default-type nil)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1405 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1406 :selected (null gnus-score-default-type)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1407 ;; The `:active' key is commented out in the following,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1408 ;; because the GNU Emacs hack to support radio buttons use
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1409 ;; active to indicate which button is selected.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1410 ["Substring" (gnus-score-set-default 'gnus-score-default-type 's)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1411 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1412 ;; :active (not (memq gnus-score-default-header '(l d)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1413 :selected (eq gnus-score-default-type 's)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1414 ["Regexp" (gnus-score-set-default 'gnus-score-default-type 'r)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1415 :style radio
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1416 ;; :active (not (memq gnus-score-default-header '(l d)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1417 :selected (eq gnus-score-default-type 'r)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1418 ["Exact" (gnus-score-set-default 'gnus-score-default-type 'e)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1419 :style radio
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1420 ;; :active (not (memq gnus-score-default-header '(l d)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1421 :selected (eq gnus-score-default-type 'e)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1422 ["Fuzzy" (gnus-score-set-default 'gnus-score-default-type 'f)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1423 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1424 ;; :active (not (memq gnus-score-default-header '(l d)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1425 :selected (eq gnus-score-default-type 'f)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1426 ["Before date" (gnus-score-set-default 'gnus-score-default-type 'b)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1427 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1428 ;; :active (eq (gnus-score-default-header 'd))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1429 :selected (eq gnus-score-default-type 'b)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1430 ["At date" (gnus-score-set-default 'gnus-score-default-type 'n)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1431 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1432 ;; :active (eq (gnus-score-default-header 'd))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1433 :selected (eq gnus-score-default-type 'n)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1434 ["After date" (gnus-score-set-default 'gnus-score-default-type 'a)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1435 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1436 ;; :active (eq (gnus-score-default-header 'd))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1437 :selected (eq gnus-score-default-type 'a)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1438 ["Less than number"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1439 (gnus-score-set-default 'gnus-score-default-type '<)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1440 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1441 ;; :active (eq (gnus-score-default-header 'l))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1442 :selected (eq gnus-score-default-type '<)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1443 ["Equal to number"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1444 (gnus-score-set-default 'gnus-score-default-type '=)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1445 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1446 ;; :active (eq (gnus-score-default-header 'l))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1447 :selected (eq gnus-score-default-type '=)]
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1448 ["Greater than number"
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1449 (gnus-score-set-default 'gnus-score-default-type '>)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1450 :style radio
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1451 ;; :active (eq (gnus-score-default-header 'l))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1452 :selected (eq gnus-score-default-type '>)])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1453 ["Default fold" gnus-score-default-fold-toggle
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1454 :style toggle
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1455 :selected gnus-score-default-fold]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1456 ("Default duration"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1457 ["Ask" (gnus-score-set-default 'gnus-score-default-duration nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1458 :style radio
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1459 :selected (null gnus-score-default-duration)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1460 ["Permanent"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1461 (gnus-score-set-default 'gnus-score-default-duration 'p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1462 :style radio
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1463 :selected (eq gnus-score-default-duration 'p)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1464 ["Temporary"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1465 (gnus-score-set-default 'gnus-score-default-duration 't)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1466 :style radio
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1467 :selected (eq gnus-score-default-duration 't)]
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1468 ["Immediate"
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1469 (gnus-score-set-default 'gnus-score-default-duration 'i)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1470 :style radio
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1471 :selected (eq gnus-score-default-duration 'i)]))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1472
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1473 (easy-menu-define
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1474 gnus-summary-article-menu gnus-summary-mode-map ""
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1475 '("Article"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1476 ("Hide"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1477 ["All" gnus-article-hide t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1478 ["Headers" gnus-article-hide-headers t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1479 ["Signature" gnus-article-hide-signature t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1480 ["Citation" gnus-article-hide-citation t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1481 ["PGP" gnus-article-hide-pgp t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1482 ["Boring headers" gnus-article-hide-boring-headers t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1483 ("Highlight"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1484 ["All" gnus-article-highlight t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1485 ["Headers" gnus-article-highlight-headers t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1486 ["Signature" gnus-article-highlight-signature t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1487 ["Citation" gnus-article-highlight-citation t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1488 ("Date"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1489 ["Local" gnus-article-date-local t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1490 ["UT" gnus-article-date-ut t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1491 ["Original" gnus-article-date-original t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1492 ["Lapsed" gnus-article-date-lapsed t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1493 ["User-defined" gnus-article-date-user t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1494 ("Washing"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1495 ("Remove Blanks"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1496 ["Leading" gnus-article-strip-leading-blank-lines t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1497 ["Multiple" gnus-article-strip-multiple-blank-lines t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1498 ["Trailing" gnus-article-remove-trailing-blank-lines t]
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
1499 ["All of the above" gnus-article-strip-blank-lines t]
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
1500 ["Leading space" gnus-article-strip-leading-space t])
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1501 ["Overstrike" gnus-article-treat-overstrike t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1502 ["Emphasis" gnus-article-emphasize t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1503 ["Word wrap" gnus-article-fill-cited-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1504 ["CR" gnus-article-remove-cr t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1505 ["Show X-Face" gnus-article-display-x-face t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1506 ["Quoted-Printable" gnus-article-de-quoted-unreadable t]
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1507 ["UnHTMLize" gnus-article-treat-html t]
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1508 ["Rot 13" gnus-summary-caesar-message t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1509 ["Unix pipe" gnus-summary-pipe-message t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1510 ["Add buttons" gnus-article-add-buttons t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1511 ["Add buttons to head" gnus-article-add-buttons-to-head t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1512 ["Stop page breaking" gnus-summary-stop-page-breaking t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1513 ["Toggle MIME" gnus-summary-toggle-mime t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1514 ["Verbose header" gnus-summary-verbose-headers t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1515 ["Toggle header" gnus-summary-toggle-header t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1516 ("Output"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1517 ["Save in default format" gnus-summary-save-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1518 ["Save in file" gnus-summary-save-article-file t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1519 ["Save in Unix mail format" gnus-summary-save-article-mail t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1520 ["Write to file" gnus-summary-write-article-mail t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1521 ["Save in MH folder" gnus-summary-save-article-folder t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1522 ["Save in VM folder" gnus-summary-save-article-vm t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1523 ["Save in RMAIL mbox" gnus-summary-save-article-rmail t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1524 ["Save body in file" gnus-summary-save-article-body-file t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1525 ["Pipe through a filter" gnus-summary-pipe-output t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1526 ["Add to SOUP packet" gnus-soup-add-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1527 ["Print" gnus-summary-print-article t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1528 ("Backend"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1529 ["Respool article..." gnus-summary-respool-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1530 ["Move article..." gnus-summary-move-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1531 (gnus-check-backend-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1532 'request-move-article gnus-newsgroup-name)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1533 ["Copy article..." gnus-summary-copy-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1534 ["Crosspost article..." gnus-summary-crosspost-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1535 (gnus-check-backend-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1536 'request-replace-article gnus-newsgroup-name)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1537 ["Import file..." gnus-summary-import-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1538 ["Check if posted" gnus-summary-article-posted-p t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1539 ["Edit article" gnus-summary-edit-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1540 (not (gnus-group-read-only-p))]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1541 ["Delete article" gnus-summary-delete-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1542 (gnus-check-backend-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1543 'request-expire-articles gnus-newsgroup-name)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1544 ["Query respool" gnus-summary-respool-query t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1545 ["Delete expirable articles" gnus-summary-expire-articles-now
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1546 (gnus-check-backend-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1547 'request-expire-articles gnus-newsgroup-name)])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1548 ("Extract"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1549 ["Uudecode" gnus-uu-decode-uu t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1550 ["Uudecode and save" gnus-uu-decode-uu-and-save t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1551 ["Unshar" gnus-uu-decode-unshar t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1552 ["Unshar and save" gnus-uu-decode-unshar-and-save t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1553 ["Save" gnus-uu-decode-save t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1554 ["Binhex" gnus-uu-decode-binhex t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1555 ["Postscript" gnus-uu-decode-postscript t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1556 ("Cache"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1557 ["Enter article" gnus-cache-enter-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1558 ["Remove article" gnus-cache-remove-article t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1559 ["Enter digest buffer" gnus-summary-enter-digest-group t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1560 ["Isearch article..." gnus-summary-isearch-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1561 ["Beginning of the article" gnus-summary-beginning-of-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1562 ["End of the article" gnus-summary-end-of-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1563 ["Fetch parent of article" gnus-summary-refer-parent-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1564 ["Fetch referenced articles" gnus-summary-refer-references t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1565 ["Fetch article with id..." gnus-summary-refer-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1566 ["Redisplay" gnus-summary-show-article t]))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1567
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1568 (easy-menu-define
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1569 gnus-summary-thread-menu gnus-summary-mode-map ""
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1570 '("Threads"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1571 ["Toggle threading" gnus-summary-toggle-threads t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1572 ["Hide threads" gnus-summary-hide-all-threads t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1573 ["Show threads" gnus-summary-show-all-threads t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1574 ["Hide thread" gnus-summary-hide-thread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1575 ["Show thread" gnus-summary-show-thread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1576 ["Go to next thread" gnus-summary-next-thread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1577 ["Go to previous thread" gnus-summary-prev-thread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1578 ["Go down thread" gnus-summary-down-thread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1579 ["Go up thread" gnus-summary-up-thread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1580 ["Top of thread" gnus-summary-top-thread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1581 ["Mark thread as read" gnus-summary-kill-thread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1582 ["Lower thread score" gnus-summary-lower-thread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1583 ["Raise thread score" gnus-summary-raise-thread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1584 ["Rethread current" gnus-summary-rethread-current t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1585 ))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1586
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1587 (easy-menu-define
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1588 gnus-summary-post-menu gnus-summary-mode-map ""
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1589 '("Post"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1590 ["Post an article" gnus-summary-post-news t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1591 ["Followup" gnus-summary-followup t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1592 ["Followup and yank" gnus-summary-followup-with-original t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1593 ["Supersede article" gnus-summary-supersede-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1594 ["Cancel article" gnus-summary-cancel-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1595 ["Reply" gnus-summary-reply t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1596 ["Reply and yank" gnus-summary-reply-with-original t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1597 ["Wide reply" gnus-summary-wide-reply t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1598 ["Wide reply and yank" gnus-summary-wide-reply-with-original t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1599 ["Mail forward" gnus-summary-mail-forward t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1600 ["Post forward" gnus-summary-post-forward t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1601 ["Digest and mail" gnus-uu-digest-mail-forward t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1602 ["Digest and post" gnus-uu-digest-post-forward t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1603 ["Resend message" gnus-summary-resend-message t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1604 ["Send bounced mail" gnus-summary-resend-bounced-mail t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1605 ["Send a mail" gnus-summary-mail-other-window t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1606 ["Uuencode and post" gnus-uu-post-news t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1607 ["Followup via news" gnus-summary-followup-to-mail t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1608 ["Followup via news and yank"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1609 gnus-summary-followup-to-mail-with-original t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1610 ;;("Draft"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1611 ;;["Send" gnus-summary-send-draft t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1612 ;;["Send bounced" gnus-resend-bounced-mail t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1613 ))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1614
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1615 (easy-menu-define
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1616 gnus-summary-misc-menu gnus-summary-mode-map ""
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1617 '("Misc"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1618 ("Mark Read"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1619 ["Mark as read" gnus-summary-mark-as-read-forward t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1620 ["Mark same subject and select"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1621 gnus-summary-kill-same-subject-and-select t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1622 ["Mark same subject" gnus-summary-kill-same-subject t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1623 ["Catchup" gnus-summary-catchup t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1624 ["Catchup all" gnus-summary-catchup-all t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1625 ["Catchup to here" gnus-summary-catchup-to-here t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1626 ["Catchup region" gnus-summary-mark-region-as-read t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1627 ["Mark excluded" gnus-summary-limit-mark-excluded-as-read t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1628 ("Mark Various"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1629 ["Tick" gnus-summary-tick-article-forward t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1630 ["Mark as dormant" gnus-summary-mark-as-dormant t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1631 ["Remove marks" gnus-summary-clear-mark-forward t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1632 ["Set expirable mark" gnus-summary-mark-as-expirable t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1633 ["Set bookmark" gnus-summary-set-bookmark t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1634 ["Remove bookmark" gnus-summary-remove-bookmark t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1635 ("Mark Limit"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1636 ["Marks..." gnus-summary-limit-to-marks t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1637 ["Subject..." gnus-summary-limit-to-subject t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1638 ["Author..." gnus-summary-limit-to-author t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1639 ["Age..." gnus-summary-limit-to-age t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1640 ["Score" gnus-summary-limit-to-score t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1641 ["Unread" gnus-summary-limit-to-unread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1642 ["Non-dormant" gnus-summary-limit-exclude-dormant t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1643 ["Articles" gnus-summary-limit-to-articles t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1644 ["Pop limit" gnus-summary-pop-limit t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1645 ["Show dormant" gnus-summary-limit-include-dormant t]
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1646 ["Hide childless dormant"
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1647 gnus-summary-limit-exclude-childless-dormant t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1648 ;;["Hide thread" gnus-summary-limit-exclude-thread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1649 ["Show expunged" gnus-summary-show-all-expunged t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1650 ("Process Mark"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1651 ["Set mark" gnus-summary-mark-as-processable t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1652 ["Remove mark" gnus-summary-unmark-as-processable t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1653 ["Remove all marks" gnus-summary-unmark-all-processable t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1654 ["Mark above" gnus-uu-mark-over t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1655 ["Mark series" gnus-uu-mark-series t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1656 ["Mark region" gnus-uu-mark-region t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1657 ["Mark by regexp..." gnus-uu-mark-by-regexp t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1658 ["Mark all" gnus-uu-mark-all t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1659 ["Mark buffer" gnus-uu-mark-buffer t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1660 ["Mark sparse" gnus-uu-mark-sparse t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1661 ["Mark thread" gnus-uu-mark-thread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1662 ["Unmark thread" gnus-uu-unmark-thread t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1663 ("Process Mark Sets"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1664 ["Kill" gnus-summary-kill-process-mark t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1665 ["Yank" gnus-summary-yank-process-mark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1666 gnus-newsgroup-process-stack]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1667 ["Save" gnus-summary-save-process-mark t]))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1668 ("Scroll article"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1669 ["Page forward" gnus-summary-next-page t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1670 ["Page backward" gnus-summary-prev-page t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1671 ["Line forward" gnus-summary-scroll-up t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1672 ("Move"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1673 ["Next unread article" gnus-summary-next-unread-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1674 ["Previous unread article" gnus-summary-prev-unread-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1675 ["Next article" gnus-summary-next-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1676 ["Previous article" gnus-summary-prev-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1677 ["Next unread subject" gnus-summary-next-unread-subject t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1678 ["Previous unread subject" gnus-summary-prev-unread-subject t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1679 ["Next article same subject" gnus-summary-next-same-subject t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1680 ["Previous article same subject" gnus-summary-prev-same-subject t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1681 ["First unread article" gnus-summary-first-unread-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1682 ["Best unread article" gnus-summary-best-unread-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1683 ["Go to subject number..." gnus-summary-goto-subject t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1684 ["Go to article number..." gnus-summary-goto-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1685 ["Go to the last article" gnus-summary-goto-last-article t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1686 ["Pop article off history" gnus-summary-pop-article t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1687 ("Sort"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1688 ["Sort by number" gnus-summary-sort-by-number t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1689 ["Sort by author" gnus-summary-sort-by-author t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1690 ["Sort by subject" gnus-summary-sort-by-subject t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1691 ["Sort by date" gnus-summary-sort-by-date t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1692 ["Sort by score" gnus-summary-sort-by-score t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1693 ["Sort by lines" gnus-summary-sort-by-lines t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1694 ("Help"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1695 ["Fetch group FAQ" gnus-summary-fetch-faq t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1696 ["Describe group" gnus-summary-describe-group t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1697 ["Read manual" gnus-info-find-node t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1698 ("Modes"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1699 ["Pick and read" gnus-pick-mode t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1700 ["Binary" gnus-binary-mode t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1701 ("Regeneration"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1702 ["Regenerate" gnus-summary-prepare t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1703 ["Insert cached articles" gnus-summary-insert-cached-articles t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1704 ["Toggle threading" gnus-summary-toggle-threads t])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1705 ["Filter articles..." gnus-summary-execute-command t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1706 ["Run command on subjects..." gnus-summary-universal-argument t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1707 ["Search articles forward..." gnus-summary-search-article-forward t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1708 ["Search articles backward..." gnus-summary-search-article-backward t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1709 ["Toggle line truncation" gnus-summary-toggle-truncation t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1710 ["Expand window" gnus-summary-expand-window t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1711 ["Expire expirable articles" gnus-summary-expire-articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1712 (gnus-check-backend-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1713 'request-expire-articles gnus-newsgroup-name)]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1714 ["Edit local kill file" gnus-summary-edit-local-kill t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1715 ["Edit main kill file" gnus-summary-edit-global-kill t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1716 ("Exit"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1717 ["Catchup and exit" gnus-summary-catchup-and-exit t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1718 ["Catchup all and exit" gnus-summary-catchup-and-exit t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1719 ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1720 ["Exit group" gnus-summary-exit t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1721 ["Exit group without updating" gnus-summary-exit-no-update t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1722 ["Exit and goto next group" gnus-summary-next-group t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1723 ["Exit and goto prev group" gnus-summary-prev-group t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1724 ["Reselect group" gnus-summary-reselect-current-group t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1725 ["Rescan group" gnus-summary-rescan-group t]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1726 ["Update dribble" gnus-summary-save-newsrc t])))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1727
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1728 (run-hooks 'gnus-summary-menu-hook)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1729
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1730 (defun gnus-score-set-default (var value)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1731 "A version of set that updates the GNU Emacs menu-bar."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1732 (set var value)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1733 ;; It is the message that forces the active status to be updated.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1734 (message ""))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1735
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1736 (defun gnus-make-score-map (type)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1737 "Make a summary score map of type TYPE."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1738 (if t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1739 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1740 (let ((headers '(("author" "from" string)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1741 ("subject" "subject" string)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1742 ("article body" "body" string)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1743 ("article head" "head" string)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1744 ("xref" "xref" string)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1745 ("lines" "lines" number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1746 ("followups to author" "followup" string)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1747 (types '((number ("less than" <)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1748 ("greater than" >)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1749 ("equal" =))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1750 (string ("substring" s)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1751 ("exact string" e)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1752 ("fuzzy string" f)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1753 ("regexp" r))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1754 (perms '(("temporary" (current-time-string))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1755 ("permanent" nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1756 ("immediate" now)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1757 header)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1758 (list
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1759 (apply
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1760 'nconc
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1761 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1762 (if (eq type 'lower)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1763 "Lower score"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1764 "Increase score"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1765 (let (outh)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1766 (while headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1767 (setq header (car headers))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1768 (setq outh
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1769 (cons
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1770 (apply
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1771 'nconc
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1772 (list (car header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1773 (let ((ts (cdr (assoc (nth 2 header) types)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1774 outt)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1775 (while ts
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1776 (setq outt
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1777 (cons
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1778 (apply
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1779 'nconc
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1780 (list (caar ts))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1781 (let ((ps perms)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1782 outp)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1783 (while ps
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1784 (setq outp
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1785 (cons
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1786 (vector
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1787 (caar ps)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1788 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1789 'gnus-summary-score-entry
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1790 (nth 1 header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1791 (if (or (string= (nth 1 header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1792 "head")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1793 (string= (nth 1 header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1794 "body"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1795 ""
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
1796 (list 'gnus-summary-header
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1797 (nth 1 header)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1798 (list 'quote (nth 1 (car ts)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1799 (list 'gnus-score-default nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1800 (nth 1 (car ps))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1801 t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1802 t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1803 outp))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1804 (setq ps (cdr ps)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1805 (list (nreverse outp))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1806 outt))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1807 (setq ts (cdr ts)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1808 (list (nreverse outt))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1809 outh))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1810 (setq headers (cdr headers)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1811 (list (nreverse outh))))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1812
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1813
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1814
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1815 (defun gnus-summary-mode (&optional group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1816 "Major mode for reading articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1817
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1818 All normal editing commands are switched off.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1819 \\<gnus-summary-mode-map>
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1820 Each line in this buffer represents one article. To read an
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1821 article, you can, for instance, type `\\[gnus-summary-next-page]'. To move forwards
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1822 and backwards while displaying articles, type `\\[gnus-summary-next-unread-article]' and `\\[gnus-summary-prev-unread-article]',
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1823 respectively.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1824
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1825 You can also post articles and send mail from this buffer. To
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1826 follow up an article, type `\\[gnus-summary-followup]'. To mail a reply to the author
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1827 of an article, type `\\[gnus-summary-reply]'.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1828
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1829 There are approx. one gazillion commands you can execute in this
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1830 buffer; read the info pages for more information (`\\[gnus-info-find-node]').
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1831
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1832 The following commands are available:
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1833
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1834 \\{gnus-summary-mode-map}"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1835 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1836 (when (gnus-visual-p 'summary-menu 'menu)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1837 (gnus-summary-make-menu-bar))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1838 (kill-all-local-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1839 (gnus-summary-make-local-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1840 (gnus-make-thread-indent-array)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1841 (gnus-simplify-mode-line)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1842 (setq major-mode 'gnus-summary-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1843 (setq mode-name "Summary")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1844 (make-local-variable 'minor-mode-alist)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1845 (use-local-map gnus-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1846 (buffer-disable-undo (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1847 (setq buffer-read-only t) ;Disable modification
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1848 (setq truncate-lines t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1849 (setq selective-display t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1850 (setq selective-display-ellipses t) ;Display `...'
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
1851 (gnus-summary-set-display-table)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1852 (gnus-set-default-directory)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1853 (setq gnus-newsgroup-name group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1854 (make-local-variable 'gnus-summary-line-format)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1855 (make-local-variable 'gnus-summary-line-format-spec)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1856 (make-local-variable 'gnus-summary-mark-positions)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1857 (make-local-hook 'post-command-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1858 (gnus-add-hook 'post-command-hook 'gnus-clear-inboxes-moved nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1859 (run-hooks 'gnus-summary-mode-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1860 (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1861 (gnus-update-summary-mark-positions))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1862
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1863 (defun gnus-summary-make-local-variables ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1864 "Make all the local summary buffer variables."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1865 (let ((locals gnus-summary-local-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1866 global local)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1867 (while (setq local (pop locals))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1868 (if (consp local)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1869 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1870 (if (eq (cdr local) 'global)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1871 ;; Copy the global value of the variable.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1872 (setq global (symbol-value (car local)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1873 ;; Use the value from the list.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1874 (setq global (eval (cdr local))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1875 (make-local-variable (car local))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1876 (set (car local) global))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1877 ;; Simple nil-valued local variable.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1878 (make-local-variable local)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1879 (set local nil)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1880
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1881 (defun gnus-summary-clear-local-variables ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1882 (let ((locals gnus-summary-local-variables))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1883 (while locals
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1884 (if (consp (car locals))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1885 (and (vectorp (caar locals))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1886 (set (caar locals) nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1887 (and (vectorp (car locals))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1888 (set (car locals) nil)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1889 (setq locals (cdr locals)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1890
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1891 ;; Summary data functions.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1892
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1893 (defmacro gnus-data-number (data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1894 `(car ,data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1895
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1896 (defmacro gnus-data-set-number (data number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1897 `(setcar ,data ,number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1898
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1899 (defmacro gnus-data-mark (data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1900 `(nth 1 ,data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1901
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1902 (defmacro gnus-data-set-mark (data mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1903 `(setcar (nthcdr 1 ,data) ,mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1904
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1905 (defmacro gnus-data-pos (data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1906 `(nth 2 ,data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1907
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1908 (defmacro gnus-data-set-pos (data pos)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1909 `(setcar (nthcdr 2 ,data) ,pos))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1910
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1911 (defmacro gnus-data-header (data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1912 `(nth 3 ,data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1913
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1914 (defmacro gnus-data-set-header (data header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1915 `(setf (nth 3 ,data) ,header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1916
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1917 (defmacro gnus-data-level (data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1918 `(nth 4 ,data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1919
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1920 (defmacro gnus-data-unread-p (data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1921 `(= (nth 1 ,data) gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1922
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1923 (defmacro gnus-data-read-p (data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1924 `(/= (nth 1 ,data) gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1925
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1926 (defmacro gnus-data-pseudo-p (data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1927 `(consp (nth 3 ,data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1928
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1929 (defmacro gnus-data-find (number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1930 `(assq ,number gnus-newsgroup-data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1931
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1932 (defmacro gnus-data-find-list (number &optional data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1933 `(let ((bdata ,(or data 'gnus-newsgroup-data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1934 (memq (assq ,number bdata)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1935 bdata)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1936
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1937 (defmacro gnus-data-make (number mark pos header level)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1938 `(list ,number ,mark ,pos ,header ,level))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1939
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1940 (defun gnus-data-enter (after-article number mark pos header level offset)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1941 (let ((data (gnus-data-find-list after-article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1942 (unless data
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1943 (error "No such article: %d" after-article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1944 (setcdr data (cons (gnus-data-make number mark pos header level)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1945 (cdr data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1946 (setq gnus-newsgroup-data-reverse nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1947 (gnus-data-update-list (cddr data) offset)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1948
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1949 (defun gnus-data-enter-list (after-article list &optional offset)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1950 (when list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1951 (let ((data (and after-article (gnus-data-find-list after-article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1952 (ilist list))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1953 (or data (not after-article) (error "No such article: %d" after-article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1954 ;; Find the last element in the list to be spliced into the main
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1955 ;; list.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1956 (while (cdr list)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1957 (setq list (cdr list)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1958 (if (not data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1959 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1960 (setcdr list gnus-newsgroup-data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1961 (setq gnus-newsgroup-data ilist)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1962 (when offset
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1963 (gnus-data-update-list (cdr list) offset)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1964 (setcdr list (cdr data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1965 (setcdr data ilist)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1966 (when offset
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1967 (gnus-data-update-list (cdr list) offset)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1968 (setq gnus-newsgroup-data-reverse nil))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1969
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1970 (defun gnus-data-remove (article &optional offset)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1971 (let ((data gnus-newsgroup-data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1972 (if (= (gnus-data-number (car data)) article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1973 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1974 (setq gnus-newsgroup-data (cdr gnus-newsgroup-data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1975 gnus-newsgroup-data-reverse nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1976 (when offset
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1977 (gnus-data-update-list gnus-newsgroup-data offset)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1978 (while (cdr data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1979 (when (= (gnus-data-number (cadr data)) article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1980 (setcdr data (cddr data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1981 (when offset
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1982 (gnus-data-update-list (cdr data) offset))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1983 (setq data nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1984 gnus-newsgroup-data-reverse nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1985 (setq data (cdr data))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1986
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1987 (defmacro gnus-data-list (backward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1988 `(if ,backward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1989 (or gnus-newsgroup-data-reverse
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1990 (setq gnus-newsgroup-data-reverse
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1991 (reverse gnus-newsgroup-data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1992 gnus-newsgroup-data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1993
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1994 (defun gnus-data-update-list (data offset)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1995 "Add OFFSET to the POS of all data entries in DATA."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1996 (while data
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1997 (setcar (nthcdr 2 (car data)) (+ offset (nth 2 (car data))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1998 (setq data (cdr data))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
1999
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2000 (defun gnus-data-compute-positions ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2001 "Compute the positions of all articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2002 (let ((data gnus-newsgroup-data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2003 pos)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2004 (while data
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2005 (when (setq pos (text-property-any
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2006 (point-min) (point-max)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2007 'gnus-number (gnus-data-number (car data))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2008 (gnus-data-set-pos (car data) (+ pos 3)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2009 (setq data (cdr data)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2010
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2011 (defun gnus-summary-article-pseudo-p (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2012 "Say whether this article is a pseudo article or not."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2013 (not (vectorp (gnus-data-header (gnus-data-find article)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2014
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2015 (defmacro gnus-summary-article-sparse-p (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2016 "Say whether this article is a sparse article or not."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2017 ` (memq ,article gnus-newsgroup-sparse))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2018
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2019 (defmacro gnus-summary-article-ancient-p (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2020 "Say whether this article is a sparse article or not."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2021 `(memq ,article gnus-newsgroup-ancient))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2022
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2023 (defun gnus-article-parent-p (number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2024 "Say whether this article is a parent or not."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2025 (let ((data (gnus-data-find-list number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2026 (and (cdr data) ; There has to be an article after...
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2027 (< (gnus-data-level (car data)) ; And it has to have a higher level.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2028 (gnus-data-level (nth 1 data))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2029
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2030 (defun gnus-article-children (number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2031 "Return a list of all children to NUMBER."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2032 (let* ((data (gnus-data-find-list number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2033 (level (gnus-data-level (car data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2034 children)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2035 (setq data (cdr data))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2036 (while (and data
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2037 (= (gnus-data-level (car data)) (1+ level)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2038 (push (gnus-data-number (car data)) children)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2039 (setq data (cdr data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2040 children))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2041
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2042 (defmacro gnus-summary-skip-intangible ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2043 "If the current article is intangible, then jump to a different article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2044 '(let ((to (get-text-property (point) 'gnus-intangible)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2045 (and to (gnus-summary-goto-subject to))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2046
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2047 (defmacro gnus-summary-article-intangible-p ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2048 "Say whether this article is intangible or not."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2049 '(get-text-property (point) 'gnus-intangible))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2050
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2051 (defun gnus-article-read-p (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2052 "Say whether ARTICLE is read or not."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2053 (not (or (memq article gnus-newsgroup-marked)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2054 (memq article gnus-newsgroup-unreads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2055 (memq article gnus-newsgroup-unselected)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2056 (memq article gnus-newsgroup-dormant))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2057
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2058 ;; Some summary mode macros.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2059
106
8ff55ebd4be9 Import from CVS: tag r20-1b5
cvs
parents: 104
diff changeset
2060 (defmacro gnus-summary-article-number ()
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2061 "The article number of the article on the current line.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2062 If there isn's an article number here, then we return the current
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2063 article number."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2064 '(progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2065 (gnus-summary-skip-intangible)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2066 (or (get-text-property (point) 'gnus-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2067 (gnus-summary-last-subject))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2068
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2069 (defmacro gnus-summary-article-header (&optional number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2070 `(gnus-data-header (gnus-data-find
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2071 ,(or number '(gnus-summary-article-number)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2072
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2073 (defmacro gnus-summary-thread-level (&optional number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2074 `(if (and (eq gnus-summary-make-false-root 'dummy)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2075 (get-text-property (point) 'gnus-intangible))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2076 0
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2077 (gnus-data-level (gnus-data-find
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2078 ,(or number '(gnus-summary-article-number))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2079
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2080 (defmacro gnus-summary-article-mark (&optional number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2081 `(gnus-data-mark (gnus-data-find
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2082 ,(or number '(gnus-summary-article-number)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2083
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2084 (defmacro gnus-summary-article-pos (&optional number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2085 `(gnus-data-pos (gnus-data-find
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2086 ,(or number '(gnus-summary-article-number)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2087
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2088 (defalias 'gnus-summary-subject-string 'gnus-summary-article-subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2089 (defmacro gnus-summary-article-subject (&optional number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2090 "Return current subject string or nil if nothing."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2091 `(let ((headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2092 ,(if number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2093 `(gnus-data-header (assq ,number gnus-newsgroup-data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2094 '(gnus-data-header (assq (gnus-summary-article-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2095 gnus-newsgroup-data)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2096 (and headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2097 (vectorp headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2098 (mail-header-subject headers))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2099
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2100 (defmacro gnus-summary-article-score (&optional number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2101 "Return current article score."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2102 `(or (cdr (assq ,(or number '(gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2103 gnus-newsgroup-scored))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2104 gnus-summary-default-score 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2105
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2106 (defun gnus-summary-article-children (&optional number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2107 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2108 (level (gnus-data-level (car data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2109 l children)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2110 (while (and (setq data (cdr data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2111 (> (setq l (gnus-data-level (car data))) level))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2112 (and (= (1+ level) l)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2113 (push (gnus-data-number (car data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2114 children)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2115 (nreverse children)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2116
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2117 (defun gnus-summary-article-parent (&optional number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2118 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2119 (gnus-data-list t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2120 (level (gnus-data-level (car data))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2121 (if (zerop level)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2122 () ; This is a root.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2123 ;; We search until we find an article with a level less than
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2124 ;; this one. That function has to be the parent.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2125 (while (and (setq data (cdr data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2126 (not (< (gnus-data-level (car data)) level))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2127 (and data (gnus-data-number (car data))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2128
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2129 (defun gnus-unread-mark-p (mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2130 "Say whether MARK is the unread mark."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2131 (= mark gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2132
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2133 (defun gnus-read-mark-p (mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2134 "Say whether MARK is one of the marks that mark as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2135 This is all marks except unread, ticked, dormant, and expirable."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2136 (not (or (= mark gnus-unread-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2137 (= mark gnus-ticked-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2138 (= mark gnus-dormant-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2139 (= mark gnus-expirable-mark))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2140
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2141 (defmacro gnus-article-mark (number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2142 `(cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2143 ((memq ,number gnus-newsgroup-unreads) gnus-unread-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2144 ((memq ,number gnus-newsgroup-marked) gnus-ticked-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2145 ((memq ,number gnus-newsgroup-dormant) gnus-dormant-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2146 ((memq ,number gnus-newsgroup-expirable) gnus-expirable-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2147 (t (or (cdr (assq ,number gnus-newsgroup-reads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2148 gnus-ancient-mark))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2149
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2150 ;; Saving hidden threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2151
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2152 (put 'gnus-save-hidden-threads 'lisp-indent-function 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2153 (put 'gnus-save-hidden-threads 'edebug-form-spec '(body))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2154
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2155 (defmacro gnus-save-hidden-threads (&rest forms)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2156 "Save hidden threads, eval FORMS, and restore the hidden threads."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2157 (let ((config (make-symbol "config")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2158 `(let ((,config (gnus-hidden-threads-configuration)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2159 (unwind-protect
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2160 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2161 ,@forms)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2162 (gnus-restore-hidden-threads-configuration ,config)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2163
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2164 (defun gnus-hidden-threads-configuration ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2165 "Return the current hidden threads configuration."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2166 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2167 (let (config)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2168 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2169 (while (search-forward "\r" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2170 (push (1- (point)) config))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2171 config)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2172
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2173 (defun gnus-restore-hidden-threads-configuration (config)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2174 "Restore hidden threads configuration from CONFIG."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2175 (let (point buffer-read-only)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2176 (while (setq point (pop config))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2177 (when (and (< point (point-max))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2178 (goto-char point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2179 (= (following-char) ?\n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2180 (subst-char-in-region point (1+ point) ?\n ?\r)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2181
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2182 ;; Various summary mode internalish functions.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2183
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2184 (defun gnus-mouse-pick-article (e)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2185 (interactive "e")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2186 (mouse-set-point e)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2187 (gnus-summary-next-page nil t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2188
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2189 (defun gnus-summary-set-display-table ()
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2190 ;; Change the display table. Odd characters have a tendency to mess
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2191 ;; up nicely formatted displays - we make all possible glyphs
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2192 ;; display only a single character.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2193
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2194 ;; We start from the standard display table, if any.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2195 (let ((table (or (copy-sequence standard-display-table)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2196 (make-display-table)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2197 (i 32))
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
2198 ;; Nix out all the control chars...
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2199 (while (>= (setq i (1- i)) 0)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2200 (aset table i [??]))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2201 ;; ... but not newline and cr, of course. (cr is necessary for the
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2202 ;; selective display).
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2203 (aset table ?\n nil)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2204 (aset table ?\r nil)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2205 ;; We nix out any glyphs over 126 that are not set already.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2206 (let ((i 256))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2207 (while (>= (setq i (1- i)) 127)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2208 ;; Only modify if the entry is nil.
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
2209 (unless (aref table i)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
2210 (aset table i [??]))))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2211 (setq buffer-display-table table)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
2212
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2213 (defun gnus-summary-setup-buffer (group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2214 "Initialize summary buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2215 (let ((buffer (concat "*Summary " group "*")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2216 (if (get-buffer buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2217 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2218 (set-buffer buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2219 (setq gnus-summary-buffer (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2220 (not gnus-newsgroup-prepared))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2221 ;; Fix by Sudish Joseph <joseph@cis.ohio-state.edu>
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2222 (setq gnus-summary-buffer (set-buffer (get-buffer-create buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2223 (gnus-add-current-to-buffer-list)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2224 (gnus-summary-mode group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2225 (when gnus-carpal
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2226 (gnus-carpal-setup-buffer 'summary))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2227 (unless gnus-single-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2228 (make-local-variable 'gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2229 (make-local-variable 'gnus-article-current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2230 (make-local-variable 'gnus-original-article-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2231 (setq gnus-newsgroup-name group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2232 t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2233
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2234 (defun gnus-set-global-variables ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2235 ;; Set the global equivalents of the summary buffer-local variables
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2236 ;; to the latest values they had. These reflect the summary buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2237 ;; that was in action when the last article was fetched.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2238 (when (eq major-mode 'gnus-summary-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2239 (setq gnus-summary-buffer (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2240 (let ((name gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2241 (marked gnus-newsgroup-marked)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2242 (unread gnus-newsgroup-unreads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2243 (headers gnus-current-headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2244 (data gnus-newsgroup-data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2245 (summary gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2246 (article-buffer gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2247 (original gnus-original-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2248 (gac gnus-article-current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2249 (reffed gnus-reffed-article-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2250 (score-file gnus-current-score-file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2251 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2252 (set-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2253 (setq gnus-newsgroup-name name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2254 (setq gnus-newsgroup-marked marked)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2255 (setq gnus-newsgroup-unreads unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2256 (setq gnus-current-headers headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2257 (setq gnus-newsgroup-data data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2258 (setq gnus-article-current gac)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2259 (setq gnus-summary-buffer summary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2260 (setq gnus-article-buffer article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2261 (setq gnus-original-article-buffer original)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2262 (setq gnus-reffed-article-number reffed)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2263 (setq gnus-current-score-file score-file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2264 ;; The article buffer also has local variables.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2265 (when (gnus-buffer-live-p gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2266 (set-buffer gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2267 (setq gnus-summary-buffer summary))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2268
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2269 (defun gnus-summary-article-unread-p (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2270 "Say whether ARTICLE is unread or not."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2271 (memq article gnus-newsgroup-unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2272
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2273 (defun gnus-summary-first-article-p (&optional article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2274 "Return whether ARTICLE is the first article in the buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2275 (if (not (setq article (or article (gnus-summary-article-number))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2276 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2277 (eq article (caar gnus-newsgroup-data))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2278
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2279 (defun gnus-summary-last-article-p (&optional article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2280 "Return whether ARTICLE is the last article in the buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2281 (if (not (setq article (or article (gnus-summary-article-number))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2282 t ; All non-existent numbers are the last article. :-)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2283 (not (cdr (gnus-data-find-list article)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2284
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2285 (defun gnus-make-thread-indent-array ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2286 (let ((n 200))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2287 (unless (and gnus-thread-indent-array
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2288 (= gnus-thread-indent-level gnus-thread-indent-array-level))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2289 (setq gnus-thread-indent-array (make-vector 201 "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2290 gnus-thread-indent-array-level gnus-thread-indent-level)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2291 (while (>= n 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2292 (aset gnus-thread-indent-array n
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2293 (make-string (* n gnus-thread-indent-level) ? ))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2294 (setq n (1- n))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2295
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2296 (defun gnus-update-summary-mark-positions ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2297 "Compute where the summary marks are to go."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2298 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2299 (when (and gnus-summary-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2300 (get-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2301 (buffer-name (get-buffer gnus-summary-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2302 (set-buffer gnus-summary-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2303 (let ((gnus-replied-mark 129)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2304 (gnus-score-below-mark 130)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2305 (gnus-score-over-mark 130)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2306 (spec gnus-summary-line-format-spec)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2307 thread gnus-visual pos)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2308 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2309 (gnus-set-work-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2310 (let ((gnus-summary-line-format-spec spec))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2311 (gnus-summary-insert-line
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2312 [0 "" "" "" "" "" 0 0 ""] 0 nil 128 t nil "" nil 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2313 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2314 (setq pos (list (cons 'unread (and (search-forward "\200" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2315 (- (point) 2)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2316 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2317 (push (cons 'replied (and (search-forward "\201" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2318 (- (point) 2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2319 pos)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2320 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2321 (push (cons 'score (and (search-forward "\202" nil t) (- (point) 2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2322 pos)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2323 (setq gnus-summary-mark-positions pos))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2324
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2325 (defun gnus-summary-insert-dummy-line (gnus-tmp-subject gnus-tmp-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2326 "Insert a dummy root in the summary buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2327 (beginning-of-line)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2328 (gnus-add-text-properties
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2329 (point) (progn (eval gnus-summary-dummy-line-format-spec) (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2330 (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2331
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2332 (defun gnus-summary-insert-line (gnus-tmp-header
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2333 gnus-tmp-level gnus-tmp-current
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2334 gnus-tmp-unread gnus-tmp-replied
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2335 gnus-tmp-expirable gnus-tmp-subject-or-nil
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2336 &optional gnus-tmp-dummy gnus-tmp-score
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2337 gnus-tmp-process)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2338 (let* ((gnus-tmp-indentation (aref gnus-thread-indent-array gnus-tmp-level))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2339 (gnus-tmp-lines (mail-header-lines gnus-tmp-header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2340 (gnus-tmp-score (or gnus-tmp-score gnus-summary-default-score 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2341 (gnus-tmp-score-char
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2342 (if (or (null gnus-summary-default-score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2343 (<= (abs (- gnus-tmp-score gnus-summary-default-score))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2344 gnus-summary-zcore-fuzz))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2345 ?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2346 (if (< gnus-tmp-score gnus-summary-default-score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2347 gnus-score-below-mark gnus-score-over-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2348 (gnus-tmp-replied
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2349 (cond (gnus-tmp-process gnus-process-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2350 ((memq gnus-tmp-current gnus-newsgroup-cached)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2351 gnus-cached-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2352 (gnus-tmp-replied gnus-replied-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2353 ((memq gnus-tmp-current gnus-newsgroup-saved)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2354 gnus-saved-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2355 (t gnus-unread-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2356 (gnus-tmp-from (mail-header-from gnus-tmp-header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2357 (gnus-tmp-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2358 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2359 ((string-match "<[^>]+> *$" gnus-tmp-from)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2360 (let ((beg (match-beginning 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2361 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2362 (substring gnus-tmp-from (1+ (match-beginning 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2363 (1- (match-end 0))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2364 (substring gnus-tmp-from 0 beg))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2365 ((string-match "(.+)" gnus-tmp-from)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2366 (substring gnus-tmp-from
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2367 (1+ (match-beginning 0)) (1- (match-end 0))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2368 (t gnus-tmp-from)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2369 (gnus-tmp-subject (mail-header-subject gnus-tmp-header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2370 (gnus-tmp-number (mail-header-number gnus-tmp-header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2371 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2372 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\]))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2373 (buffer-read-only nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2374 (when (string= gnus-tmp-name "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2375 (setq gnus-tmp-name gnus-tmp-from))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2376 (unless (numberp gnus-tmp-lines)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2377 (setq gnus-tmp-lines 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2378 (gnus-put-text-property
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2379 (point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2380 (progn (eval gnus-summary-line-format-spec) (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2381 'gnus-number gnus-tmp-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2382 (when (gnus-visual-p 'summary-highlight 'highlight)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2383 (forward-line -1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2384 (run-hooks 'gnus-summary-update-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2385 (forward-line 1))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2386
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2387 (defun gnus-summary-update-line (&optional dont-update)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2388 ;; Update summary line after change.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2389 (when (and gnus-summary-default-score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2390 (not gnus-summary-inhibit-highlight))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2391 (let* ((gnus-summary-inhibit-highlight t) ; Prevent recursion.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2392 (article (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2393 (score (gnus-summary-article-score article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2394 (unless dont-update
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2395 (if (and gnus-summary-mark-below
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2396 (< (gnus-summary-article-score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2397 gnus-summary-mark-below))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2398 ;; This article has a low score, so we mark it as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2399 (when (memq article gnus-newsgroup-unreads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2400 (gnus-summary-mark-article-as-read gnus-low-score-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2401 (when (eq (gnus-summary-article-mark) gnus-low-score-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2402 ;; This article was previously marked as read on account
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2403 ;; of a low score, but now it has risen, so we mark it as
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2404 ;; unread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2405 (gnus-summary-mark-article-as-unread gnus-unread-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2406 (gnus-summary-update-mark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2407 (if (or (null gnus-summary-default-score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2408 (<= (abs (- score gnus-summary-default-score))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2409 gnus-summary-zcore-fuzz))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2410 ?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2411 (if (< score gnus-summary-default-score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2412 gnus-score-below-mark gnus-score-over-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2413 'score))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2414 ;; Do visual highlighting.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2415 (when (gnus-visual-p 'summary-highlight 'highlight)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2416 (run-hooks 'gnus-summary-update-hook)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2417
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2418 (defvar gnus-tmp-new-adopts nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2419
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2420 (defun gnus-summary-number-of-articles-in-thread (thread &optional level char)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2421 "Return the number of articles in THREAD.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2422 This may be 0 in some cases -- if none of the articles in
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2423 the thread are to be displayed."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2424 (let* ((number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2425 ;; Fix by Luc Van Eycken <Luc.VanEycken@esat.kuleuven.ac.be>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2426 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2427 ((not (listp thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2428 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2429 ((and (consp thread) (cdr thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2430 (apply
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2431 '+ 1 (mapcar
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2432 'gnus-summary-number-of-articles-in-thread (cdr thread))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2433 ((null thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2434 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2435 ((memq (mail-header-number (car thread)) gnus-newsgroup-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2436 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2437 (t 0))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2438 (when (and level (zerop level) gnus-tmp-new-adopts)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2439 (incf number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2440 (apply '+ (mapcar
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2441 'gnus-summary-number-of-articles-in-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2442 gnus-tmp-new-adopts))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2443 (if char
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2444 (if (> number 1) gnus-not-empty-thread-mark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2445 gnus-empty-thread-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2446 number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2447
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2448 (defun gnus-summary-set-local-parameters (group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2449 "Go through the local params of GROUP and set all variable specs in that list."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2450 (let ((params (gnus-group-find-parameter group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2451 elem)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2452 (while params
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2453 (setq elem (car params)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2454 params (cdr params))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2455 (and (consp elem) ; Has to be a cons.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2456 (consp (cdr elem)) ; The cdr has to be a list.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2457 (symbolp (car elem)) ; Has to be a symbol in there.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2458 (not (memq (car elem)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2459 '(quit-config to-address to-list to-group)))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
2460 (ignore-errors ; So we set it.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2461 (make-local-variable (car elem))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2462 (set (car elem) (eval (nth 1 elem))))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2463
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2464 (defun gnus-summary-read-group (group &optional show-all no-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2465 kill-buffer no-display)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2466 "Start reading news in newsgroup GROUP.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2467 If SHOW-ALL is non-nil, already read articles are also listed.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2468 If NO-ARTICLE is non-nil, no article is selected initially.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2469 If NO-DISPLAY, don't generate a summary buffer."
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2470 (let (result)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2471 (while (and group
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2472 (null (setq result
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2473 (let ((gnus-auto-select-next nil))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2474 (gnus-summary-read-group-1
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2475 group show-all no-article
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2476 kill-buffer no-display))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2477 (eq gnus-auto-select-next 'quietly))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2478 (set-buffer gnus-group-buffer)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2479 (if (not (equal group (gnus-group-group-name)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2480 (setq group (gnus-group-group-name))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2481 (setq group nil)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2482 result))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2483
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2484 (defun gnus-summary-read-group-1 (group show-all no-article
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2485 kill-buffer no-display)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2486 ;; Killed foreign groups can't be entered.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2487 (when (and (not (gnus-group-native-p group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2488 (not (gnus-gethash group gnus-newsrc-hashtb)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2489 (error "Dead non-native groups can't be entered"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2490 (gnus-message 5 "Retrieving newsgroup: %s..." group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2491 (let* ((new-group (gnus-summary-setup-buffer group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2492 (quit-config (gnus-group-quit-config group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2493 (did-select (and new-group (gnus-select-newsgroup group show-all))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2494 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2495 ;; This summary buffer exists already, so we just select it.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2496 ((not new-group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2497 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2498 (when kill-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2499 (gnus-kill-or-deaden-summary kill-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2500 (gnus-configure-windows 'summary 'force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2501 (gnus-set-mode-line 'summary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2502 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2503 (message "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2504 t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2505 ;; We couldn't select this group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2506 ((null did-select)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2507 (when (and (eq major-mode 'gnus-summary-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2508 (not (equal (current-buffer) kill-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2509 (kill-buffer (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2510 (if (not quit-config)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2511 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2512 (set-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2513 (gnus-group-jump-to-group group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2514 (gnus-group-next-unread-group 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2515 (gnus-handle-ephemeral-exit quit-config)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2516 (gnus-message 3 "Can't select group")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2517 nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2518 ;; The user did a `C-g' while prompting for number of articles,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2519 ;; so we exit this group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2520 ((eq did-select 'quit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2521 (and (eq major-mode 'gnus-summary-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2522 (not (equal (current-buffer) kill-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2523 (kill-buffer (current-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2524 (when kill-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2525 (gnus-kill-or-deaden-summary kill-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2526 (if (not quit-config)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2527 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2528 (set-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2529 (gnus-group-jump-to-group group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2530 (gnus-group-next-unread-group 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2531 (gnus-configure-windows 'group 'force))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2532 (gnus-handle-ephemeral-exit quit-config))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2533 ;; Finally signal the quit.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2534 (signal 'quit nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2535 ;; The group was successfully selected.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2536 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2537 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2538 ;; Save the active value in effect when the group was entered.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2539 (setq gnus-newsgroup-active
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2540 (gnus-copy-sequence
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2541 (gnus-active gnus-newsgroup-name)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2542 ;; You can change the summary buffer in some way with this hook.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2543 (run-hooks 'gnus-select-group-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2544 ;; Set any local variables in the group parameters.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2545 (gnus-summary-set-local-parameters gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2546 (gnus-update-format-specifications
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2547 nil 'summary 'summary-mode 'summary-dummy)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2548 ;; Do score processing.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2549 (when gnus-use-scoring
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2550 (gnus-possibly-score-headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2551 ;; Check whether to fill in the gaps in the threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2552 (when gnus-build-sparse-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2553 (gnus-build-sparse-threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2554 ;; Find the initial limit.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2555 (if gnus-show-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2556 (if show-all
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2557 (let ((gnus-newsgroup-dormant nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2558 (gnus-summary-initial-limit show-all))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2559 (gnus-summary-initial-limit show-all))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2560 (setq gnus-newsgroup-limit
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2561 (mapcar
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2562 (lambda (header) (mail-header-number header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2563 gnus-newsgroup-headers)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2564 ;; Generate the summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2565 (unless no-display
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2566 (gnus-summary-prepare))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2567 (when gnus-use-trees
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2568 (gnus-tree-open group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2569 (setq gnus-summary-highlight-line-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2570 'gnus-tree-highlight-article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2571 ;; If the summary buffer is empty, but there are some low-scored
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2572 ;; articles or some excluded dormants, we include these in the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2573 ;; buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2574 (when (and (zerop (buffer-size))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2575 (not no-display))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2576 (cond (gnus-newsgroup-dormant
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2577 (gnus-summary-limit-include-dormant))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2578 ((and gnus-newsgroup-scored show-all)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2579 (gnus-summary-limit-include-expunged t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2580 ;; Function `gnus-apply-kill-file' must be called in this hook.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2581 (run-hooks 'gnus-apply-kill-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2582 (if (and (zerop (buffer-size))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2583 (not no-display))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2584 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2585 ;; This newsgroup is empty.
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2586 (gnus-summary-catchup-and-exit nil t)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2587 (gnus-message 6 "No unread news")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2588 (when kill-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2589 (gnus-kill-or-deaden-summary kill-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2590 ;; Return nil from this function.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2591 nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2592 ;; Hide conversation thread subtrees. We cannot do this in
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2593 ;; gnus-summary-prepare-hook since kill processing may not
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2594 ;; work with hidden articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2595 (and gnus-show-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2596 gnus-thread-hide-subtree
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2597 (gnus-summary-hide-all-threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2598 ;; Show first unread article if requested.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2599 (if (and (not no-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2600 (not no-display)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2601 gnus-newsgroup-unreads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2602 gnus-auto-select-first)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2603 (unless (if (eq gnus-auto-select-first 'best)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2604 (gnus-summary-best-unread-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2605 (gnus-summary-first-unread-article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2606 (gnus-configure-windows 'summary))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2607 ;; Don't select any articles, just move point to the first
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2608 ;; article in the group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2609 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2610 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2611 (gnus-set-mode-line 'summary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2612 (gnus-configure-windows 'summary 'force))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2613 (when kill-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2614 (gnus-kill-or-deaden-summary kill-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2615 (when (get-buffer-window gnus-group-buffer t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2616 ;; Gotta use windows, because recenter does weird stuff if
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2617 ;; the current buffer ain't the displayed window.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2618 (let ((owin (selected-window)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2619 (select-window (get-buffer-window gnus-group-buffer t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2620 (when (gnus-group-goto-group group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2621 (recenter))
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2622 (select-window owin)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2623 ;; Mark this buffer as "prepared".
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2624 (setq gnus-newsgroup-prepared t)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2625 t)))))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2626
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2627 (defun gnus-summary-prepare ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2628 "Generate the summary buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2629 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2630 (let ((buffer-read-only nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2631 (erase-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2632 (setq gnus-newsgroup-data nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2633 gnus-newsgroup-data-reverse nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2634 (run-hooks 'gnus-summary-generate-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2635 ;; Generate the buffer, either with threads or without.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2636 (when gnus-newsgroup-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2637 (gnus-summary-prepare-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2638 (if gnus-show-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2639 (gnus-sort-gathered-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2640 (funcall gnus-summary-thread-gathering-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2641 (gnus-sort-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2642 (gnus-cut-threads (gnus-make-threads)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2643 ;; Unthreaded display.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2644 (gnus-sort-articles gnus-newsgroup-headers))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2645 (setq gnus-newsgroup-data (nreverse gnus-newsgroup-data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2646 ;; Call hooks for modifying summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2647 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2648 (run-hooks 'gnus-summary-prepare-hook)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2649
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2650 (defsubst gnus-general-simplify-subject (subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2651 "Simply subject by the same rules as gnus-gather-threads-by-subject."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2652 (setq subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2653 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2654 ;; Truncate the subject.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2655 ((numberp gnus-summary-gather-subject-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2656 (setq subject (gnus-simplify-subject-re subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2657 (if (> (length subject) gnus-summary-gather-subject-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2658 (substring subject 0 gnus-summary-gather-subject-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2659 subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2660 ;; Fuzzily simplify it.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2661 ((eq 'fuzzy gnus-summary-gather-subject-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2662 (gnus-simplify-subject-fuzzy subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2663 ;; Just remove the leading "Re:".
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2664 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2665 (gnus-simplify-subject-re subject))))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2666
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2667 (if (and gnus-summary-gather-exclude-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2668 (string-match gnus-summary-gather-exclude-subject subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2669 nil ; This article shouldn't be gathered
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2670 subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2671
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2672 (defun gnus-summary-simplify-subject-query ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2673 "Query where the respool algorithm would put this article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2674 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2675 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2676 (gnus-summary-select-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2677 (message (gnus-general-simplify-subject (gnus-summary-article-subject))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2678
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2679 (defun gnus-gather-threads-by-subject (threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2680 "Gather threads by looking at Subject headers."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2681 (if (not gnus-summary-make-false-root)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2682 threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2683 (let ((hashtb (gnus-make-hashtable 1024))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2684 (prev threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2685 (result threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2686 subject hthread whole-subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2687 (while threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2688 (setq subject (gnus-general-simplify-subject
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2689 (setq whole-subject (mail-header-subject
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2690 (caar threads)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2691 (when subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2692 (if (setq hthread (gnus-gethash subject hashtb))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2693 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2694 ;; We enter a dummy root into the thread, if we
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2695 ;; haven't done that already.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2696 (unless (stringp (caar hthread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2697 (setcar hthread (list whole-subject (car hthread))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2698 ;; We add this new gathered thread to this gathered
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2699 ;; thread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2700 (setcdr (car hthread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2701 (nconc (cdar hthread) (list (car threads))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2702 ;; Remove it from the list of threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2703 (setcdr prev (cdr threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2704 (setq threads prev))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2705 ;; Enter this thread into the hash table.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2706 (gnus-sethash subject threads hashtb)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2707 (setq prev threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2708 (setq threads (cdr threads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2709 result)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2710
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2711 (defun gnus-gather-threads-by-references (threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2712 "Gather threads by looking at References headers."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2713 (let ((idhashtb (gnus-make-hashtable 1024))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2714 (thhashtb (gnus-make-hashtable 1024))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2715 (prev threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2716 (result threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2717 ids references id gthread gid entered ref)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2718 (while threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2719 (when (setq references (mail-header-references (caar threads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2720 (setq id (mail-header-id (caar threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2721 ids (gnus-split-references references)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2722 entered nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2723 (while (setq ref (pop ids))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2724 (setq ids (delete ref ids))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2725 (if (not (setq gid (gnus-gethash ref idhashtb)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2726 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2727 (gnus-sethash ref id idhashtb)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2728 (gnus-sethash id threads thhashtb))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2729 (setq gthread (gnus-gethash gid thhashtb))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2730 (unless entered
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2731 ;; We enter a dummy root into the thread, if we
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2732 ;; haven't done that already.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2733 (unless (stringp (caar gthread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2734 (setcar gthread (list (mail-header-subject (caar gthread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2735 (car gthread))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2736 ;; We add this new gathered thread to this gathered
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2737 ;; thread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2738 (setcdr (car gthread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2739 (nconc (cdar gthread) (list (car threads)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2740 ;; Add it into the thread hash table.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2741 (gnus-sethash id gthread thhashtb)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2742 (setq entered t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2743 ;; Remove it from the list of threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2744 (setcdr prev (cdr threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2745 (setq threads prev))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2746 (setq prev threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2747 (setq threads (cdr threads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2748 result))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2749
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2750 (defun gnus-sort-gathered-threads (threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2751 "Sort subtreads inside each gathered thread by article number."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2752 (let ((result threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2753 (while threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2754 (when (stringp (caar threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2755 (setcdr (car threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2756 (sort (cdar threads) 'gnus-thread-sort-by-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2757 (setq threads (cdr threads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2758 result))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2759
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2760 (defun gnus-thread-loop-p (root thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2761 "Say whether ROOT is in THREAD."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2762 (let ((th (cdr thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2763 (while (and th
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2764 (not (eq (caar th) root)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2765 (pop th))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2766 (if th
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2767 ;; We have found a loop.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2768 (let (ref-dep)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2769 (setcdr thread (delq (car th) (cdr thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2770 (if (boundp (setq ref-dep (intern "none"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2771 gnus-newsgroup-dependencies)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2772 (setcdr (symbol-value ref-dep)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2773 (nconc (cdr (symbol-value ref-dep))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2774 (list (car th))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2775 (set ref-dep (list nil (car th))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2776 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2777 ;; Recurse down into the sub-threads and look for loops.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2778 (apply '+
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2779 (mapcar
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2780 (lambda (thread) (gnus-thread-loop-p root thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2781 (cdr thread))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2782
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2783 (defun gnus-make-threads ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2784 "Go through the dependency hashtb and find the roots. Return all threads."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2785 (let (threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2786 (while (catch 'infloop
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2787 (mapatoms
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2788 (lambda (refs)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2789 ;; Deal with self-referencing References loops.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2790 (when (and (car (symbol-value refs))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2791 (not (zerop
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2792 (apply
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2793 '+
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2794 (mapcar
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2795 (lambda (thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2796 (gnus-thread-loop-p
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2797 (car (symbol-value refs)) thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2798 (cdr (symbol-value refs)))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2799 (setq threads nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2800 (throw 'infloop t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2801 (unless (car (symbol-value refs))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2802 ;; These threads do not refer back to any other articles,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2803 ;; so they're roots.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2804 (setq threads (append (cdr (symbol-value refs)) threads))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2805 gnus-newsgroup-dependencies)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2806 threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2807
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2808 (defun gnus-build-sparse-threads ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2809 (let ((headers gnus-newsgroup-headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2810 (deps gnus-newsgroup-dependencies)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2811 header references generation relations
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2812 cthread subject child end pthread relation)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2813 ;; First we create an alist of generations/relations, where
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2814 ;; generations is how much we trust the relation, and the relation
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2815 ;; is parent/child.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2816 (gnus-message 7 "Making sparse threads...")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2817 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2818 (nnheader-set-temp-buffer " *gnus sparse threads*")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2819 (while (setq header (pop headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2820 (when (and (setq references (mail-header-references header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2821 (not (string= references "")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2822 (insert references)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2823 (setq child (mail-header-id header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2824 subject (mail-header-subject header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2825 (setq generation 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2826 (while (search-backward ">" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2827 (setq end (1+ (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2828 (when (search-backward "<" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2829 (push (list (incf generation)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2830 child (setq child (buffer-substring (point) end))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2831 subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2832 relations)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2833 (push (list (1+ generation) child nil subject) relations)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2834 (erase-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2835 (kill-buffer (current-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2836 ;; Sort over trustworthiness.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2837 (setq relations (sort relations (lambda (r1 r2) (< (car r1) (car r2)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2838 (while (setq relation (pop relations))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2839 (when (if (boundp (setq cthread (intern (cadr relation) deps)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2840 (unless (car (symbol-value cthread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2841 ;; Make this article the parent of these threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2842 (setcar (symbol-value cthread)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2843 (vector gnus-reffed-article-number
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2844 (cadddr relation)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2845 "" ""
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2846 (cadr relation)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2847 (or (caddr relation) "") 0 0 "")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2848 (set cthread (list (vector gnus-reffed-article-number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2849 (cadddr relation)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2850 "" "" (cadr relation)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2851 (or (caddr relation) "") 0 0 ""))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2852 (push gnus-reffed-article-number gnus-newsgroup-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2853 (push gnus-reffed-article-number gnus-newsgroup-sparse)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2854 (push (cons gnus-reffed-article-number gnus-sparse-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2855 gnus-newsgroup-reads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2856 (decf gnus-reffed-article-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2857 ;; Make this new thread the child of its parent.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2858 (if (boundp (setq pthread (intern (or (caddr relation) "none") deps)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2859 (setcdr (symbol-value pthread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2860 (nconc (cdr (symbol-value pthread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2861 (list (symbol-value cthread))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2862 (set pthread (list nil (symbol-value cthread))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2863 (gnus-message 7 "Making sparse threads...done")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2864
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2865 (defun gnus-build-old-threads ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2866 ;; Look at all the articles that refer back to old articles, and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2867 ;; fetch the headers for the articles that aren't there. This will
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2868 ;; build complete threads - if the roots haven't been expired by the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2869 ;; server, that is.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2870 (let (id heads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2871 (mapatoms
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2872 (lambda (refs)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2873 (when (not (car (symbol-value refs)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2874 (setq heads (cdr (symbol-value refs)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2875 (while heads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2876 (if (memq (mail-header-number (caar heads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2877 gnus-newsgroup-dormant)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2878 (setq heads (cdr heads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2879 (setq id (symbol-name refs))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2880 (while (and (setq id (gnus-build-get-header id))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2881 (not (car (gnus-gethash
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2882 id gnus-newsgroup-dependencies)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2883 (setq heads nil)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2884 gnus-newsgroup-dependencies)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2885
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2886 (defun gnus-build-get-header (id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2887 ;; Look through the buffer of NOV lines and find the header to
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2888 ;; ID. Enter this line into the dependencies hash table, and return
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2889 ;; the id of the parent article (if any).
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2890 (let ((deps gnus-newsgroup-dependencies)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2891 found header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2892 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2893 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2894 (set-buffer nntp-server-buffer)
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2895 (let ((case-fold-search nil))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2896 (goto-char (point-min))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2897 (while (and (not found)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2898 (search-forward id nil t))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2899 (beginning-of-line)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2900 (setq found (looking-at
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2901 (format "^[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t%s"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2902 (regexp-quote id))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2903 (or found (beginning-of-line 2)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2904 (when found
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2905 (beginning-of-line)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2906 (and
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2907 (setq header (gnus-nov-parse-line
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2908 (read (current-buffer)) deps))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2909 (gnus-parent-id (mail-header-references header))))))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2910 (when header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2911 (let ((number (mail-header-number header)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2912 (push number gnus-newsgroup-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2913 (push header gnus-newsgroup-headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2914 (if (memq number gnus-newsgroup-unselected)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2915 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2916 (push number gnus-newsgroup-unreads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2917 (setq gnus-newsgroup-unselected
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2918 (delq number gnus-newsgroup-unselected)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2919 (push number gnus-newsgroup-ancient)))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2920
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2921 (defun gnus-summary-update-article-line (article header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2922 "Update the line for ARTICLE using HEADERS."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2923 (let* ((id (mail-header-id header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2924 (thread (gnus-id-to-thread id)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2925 (unless thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2926 (error "Article in no thread"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2927 ;; Update the thread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2928 (setcar thread header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2929 (gnus-summary-goto-subject article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2930 (let* ((datal (gnus-data-find-list article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2931 (data (car datal))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2932 (length (when (cdr datal)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2933 (- (gnus-data-pos data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2934 (gnus-data-pos (cadr datal)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2935 (buffer-read-only nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2936 (level (gnus-summary-thread-level)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2937 (gnus-delete-line)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2938 (gnus-summary-insert-line
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2939 header level nil (gnus-article-mark article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2940 (memq article gnus-newsgroup-replied)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2941 (memq article gnus-newsgroup-expirable)
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
2942 ;; Only insert the Subject string when it's different
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
2943 ;; from the previous Subject string.
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2944 (if (gnus-subject-equal
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2945 (condition-case ()
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2946 (mail-header-subject
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2947 (gnus-data-header
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2948 (cadr
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2949 (gnus-data-find-list
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2950 article
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2951 (gnus-data-list t)))))
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
2952 ;; Error on the side of excessive subjects.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
2953 (error (mail-header-subject header)))
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2954 (mail-header-subject header))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2955 (mail-header-subject header)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
2956 "")
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2957 nil (cdr (assq article gnus-newsgroup-scored))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2958 (memq article gnus-newsgroup-processable))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2959 (when length
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2960 (gnus-data-update-list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2961 (cdr datal) (- length (- (gnus-data-pos data) (point))))))))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2962
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2963 (defun gnus-summary-update-article (article &optional iheader)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2964 "Update ARTICLE in the summary buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2965 (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2966 (let* ((header (or iheader (gnus-summary-article-header article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2967 (id (mail-header-id header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2968 (data (gnus-data-find article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2969 (thread (gnus-id-to-thread id))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2970 (references (mail-header-references header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2971 (parent
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2972 (gnus-id-to-thread
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
2973 (or (gnus-parent-id
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2974 (when (and references
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2975 (not (equal "" references)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2976 references))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2977 "none")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2978 (buffer-read-only nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2979 (old (car thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2980 (number (mail-header-number header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2981 pos)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2982 (when thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2983 ;; !!! Should this be in or not?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2984 (unless iheader
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2985 (setcar thread nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2986 (when parent
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2987 (delq thread parent))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2988 (if (gnus-summary-insert-subject id header iheader)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2989 ;; Set the (possibly) new article number in the data structure.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2990 (gnus-data-set-number data (gnus-id-to-article id))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2991 (setcar thread old)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2992 nil))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2993
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2994 (defun gnus-rebuild-thread (id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2995 "Rebuild the thread containing ID."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2996 (let ((buffer-read-only nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2997 old-pos current thread data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2998 (if (not gnus-show-threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
2999 (setq thread (list (car (gnus-id-to-thread id))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3000 ;; Get the thread this article is part of.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3001 (setq thread (gnus-remove-thread id)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3002 (setq old-pos (gnus-point-at-bol))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3003 (setq current (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3004 (and (zerop (forward-line -1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3005 (gnus-summary-article-number))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3006 ;; If this is a gathered thread, we have to go some re-gathering.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3007 (when (stringp (car thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3008 (let ((subject (car thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3009 roots thr)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3010 (setq thread (cdr thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3011 (while thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3012 (unless (memq (setq thr (gnus-id-to-thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3013 (gnus-root-id
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3014 (mail-header-id (caar thread)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3015 roots)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3016 (push thr roots))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3017 (setq thread (cdr thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3018 ;; We now have all (unique) roots.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3019 (if (= (length roots) 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3020 ;; All the loose roots are now one solid root.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3021 (setq thread (car roots))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3022 (setq thread (cons subject (gnus-sort-threads roots))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3023 (let (threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3024 ;; We then insert this thread into the summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3025 (let (gnus-newsgroup-data gnus-newsgroup-threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3026 (if gnus-show-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3027 (gnus-summary-prepare-threads (gnus-cut-threads (list thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3028 (gnus-summary-prepare-unthreaded thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3029 (setq data (nreverse gnus-newsgroup-data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3030 (setq threads gnus-newsgroup-threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3031 ;; We splice the new data into the data structure.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3032 (gnus-data-enter-list current data (- (point) old-pos))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3033 (setq gnus-newsgroup-threads (nconc threads gnus-newsgroup-threads)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3034
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3035 (defun gnus-number-to-header (number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3036 "Return the header for article NUMBER."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3037 (let ((headers gnus-newsgroup-headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3038 (while (and headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3039 (not (= number (mail-header-number (car headers)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3040 (pop headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3041 (when headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3042 (car headers))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3043
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3044 (defun gnus-parent-headers (headers &optional generation)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3045 "Return the headers of the GENERATIONeth parent of HEADERS."
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
3046 (unless generation
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3047 (setq generation 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3048 (let (references parent)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3049 (while (and headers (not (zerop generation)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3050 (setq references (mail-header-references headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3051 (when (and references
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3052 (setq parent (gnus-parent-id references))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3053 (setq headers (car (gnus-id-to-thread parent))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3054 (decf generation)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3055 headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3056
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3057 (defun gnus-id-to-thread (id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3058 "Return the (sub-)thread where ID appears."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3059 (gnus-gethash id gnus-newsgroup-dependencies))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3060
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3061 (defun gnus-id-to-article (id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3062 "Return the article number of ID."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3063 (let ((thread (gnus-id-to-thread id)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3064 (when (and thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3065 (car thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3066 (mail-header-number (car thread)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3067
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3068 (defun gnus-id-to-header (id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3069 "Return the article headers of ID."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3070 (car (gnus-id-to-thread id)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3071
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3072 (defun gnus-article-displayed-root-p (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3073 "Say whether ARTICLE is a root(ish) article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3074 (let ((level (gnus-summary-thread-level article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3075 (refs (mail-header-references (gnus-summary-article-header article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3076 particle)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
3077 (cond
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3078 ((null level) nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3079 ((zerop level) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3080 ((null refs) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3081 ((null (gnus-parent-id refs)) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3082 ((and (= 1 level)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3083 (null (setq particle (gnus-id-to-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3084 (gnus-parent-id refs))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3085 (null (gnus-summary-thread-level particle)))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3086
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3087 (defun gnus-root-id (id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3088 "Return the id of the root of the thread where ID appears."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3089 (let (last-id prev)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
3090 (while (and id (setq prev (car (gnus-gethash
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3091 id gnus-newsgroup-dependencies))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3092 (setq last-id id
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3093 id (gnus-parent-id (mail-header-references prev))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3094 last-id))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3095
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3096 (defun gnus-remove-thread (id &optional dont-remove)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3097 "Remove the thread that has ID in it."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3098 (let ((dep gnus-newsgroup-dependencies)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3099 headers thread last-id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3100 ;; First go up in this thread until we find the root.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3101 (setq last-id (gnus-root-id id))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3102 (setq headers (list (car (gnus-id-to-thread last-id))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3103 (caadr (gnus-id-to-thread last-id))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3104 ;; We have now found the real root of this thread. It might have
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3105 ;; been gathered into some loose thread, so we have to search
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3106 ;; through the threads to find the thread we wanted.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3107 (let ((threads gnus-newsgroup-threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3108 sub)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3109 (while threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3110 (setq sub (car threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3111 (if (stringp (car sub))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3112 ;; This is a gathered thread, so we look at the roots
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3113 ;; below it to find whether this article is in this
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3114 ;; gathered root.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3115 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3116 (setq sub (cdr sub))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3117 (while sub
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3118 (when (member (caar sub) headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3119 (setq thread (car threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3120 threads nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3121 sub nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3122 (setq sub (cdr sub))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3123 ;; It's an ordinary thread, so we check it.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3124 (when (eq (car sub) (car headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3125 (setq thread sub
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3126 threads nil)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3127 (setq threads (cdr threads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3128 ;; If this article is in no thread, then it's a root.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3129 (if thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3130 (unless dont-remove
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3131 (setq gnus-newsgroup-threads (delq thread gnus-newsgroup-threads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3132 (setq thread (gnus-gethash last-id dep)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3133 (when thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3134 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3135 thread ; We return this thread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3136 (unless dont-remove
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3137 (if (stringp (car thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3138 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3139 ;; If we use dummy roots, then we have to remove the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3140 ;; dummy root as well.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3141 (when (eq gnus-summary-make-false-root 'dummy)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3142 (gnus-delete-line)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3143 (gnus-data-compute-positions))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3144 (setq thread (cdr thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3145 (while thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3146 (gnus-remove-thread-1 (car thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3147 (setq thread (cdr thread))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3148 (gnus-remove-thread-1 thread))))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3149
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3150 (defun gnus-remove-thread-1 (thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3151 "Remove the thread THREAD recursively."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3152 (let ((number (mail-header-number (pop thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3153 d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3154 (setq thread (reverse thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3155 (while thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3156 (gnus-remove-thread-1 (pop thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3157 (when (setq d (gnus-data-find number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3158 (goto-char (gnus-data-pos d))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
3159 (gnus-data-remove
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3160 number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3161 (- (gnus-point-at-bol)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3162 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3163 (1+ (gnus-point-at-eol))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3164 (gnus-delete-line)))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3165
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3166 (defun gnus-sort-threads (threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3167 "Sort THREADS."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3168 (if (not gnus-thread-sort-functions)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3169 threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3170 (gnus-message 7 "Sorting threads...")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3171 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3172 (sort threads (gnus-make-sort-function gnus-thread-sort-functions))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3173 (gnus-message 7 "Sorting threads...done"))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3174
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3175 (defun gnus-sort-articles (articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3176 "Sort ARTICLES."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3177 (when gnus-article-sort-functions
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3178 (gnus-message 7 "Sorting articles...")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3179 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3180 (setq gnus-newsgroup-headers
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
3181 (sort articles (gnus-make-sort-function
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3182 gnus-article-sort-functions)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3183 (gnus-message 7 "Sorting articles...done"))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3184
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3185 ;; Written by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3186 (defmacro gnus-thread-header (thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3187 ;; Return header of first article in THREAD.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3188 ;; Note that THREAD must never, ever be anything else than a variable -
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3189 ;; using some other form will lead to serious barfage.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3190 (or (symbolp thread) (signal 'wrong-type-argument '(symbolp thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3191 ;; (8% speedup to gnus-summary-prepare, just for fun :-)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3192 (list 'byte-code "\10\211:\203\17\0\211@;\203\16\0A@@\207" ;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3193 (vector thread) 2))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3194
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3195 (defsubst gnus-article-sort-by-number (h1 h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3196 "Sort articles by article number."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3197 (< (mail-header-number h1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3198 (mail-header-number h2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3199
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3200 (defun gnus-thread-sort-by-number (h1 h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3201 "Sort threads by root article number."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3202 (gnus-article-sort-by-number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3203 (gnus-thread-header h1) (gnus-thread-header h2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3204
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3205 (defsubst gnus-article-sort-by-lines (h1 h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3206 "Sort articles by article Lines header."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3207 (< (mail-header-lines h1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3208 (mail-header-lines h2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3209
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3210 (defun gnus-thread-sort-by-lines (h1 h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3211 "Sort threads by root article Lines header."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3212 (gnus-article-sort-by-lines
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3213 (gnus-thread-header h1) (gnus-thread-header h2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3214
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3215 (defsubst gnus-article-sort-by-author (h1 h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3216 "Sort articles by root author."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3217 (string-lessp
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3218 (let ((extract (funcall
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3219 gnus-extract-address-components
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3220 (mail-header-from h1))))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
3221 (or (car extract) (cadr extract) ""))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3222 (let ((extract (funcall
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3223 gnus-extract-address-components
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3224 (mail-header-from h2))))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
3225 (or (car extract) (cadr extract) ""))))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3226
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3227 (defun gnus-thread-sort-by-author (h1 h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3228 "Sort threads by root author."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3229 (gnus-article-sort-by-author
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3230 (gnus-thread-header h1) (gnus-thread-header h2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3231
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3232 (defsubst gnus-article-sort-by-subject (h1 h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3233 "Sort articles by root subject."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3234 (string-lessp
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3235 (downcase (gnus-simplify-subject-re (mail-header-subject h1)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3236 (downcase (gnus-simplify-subject-re (mail-header-subject h2)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3237
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3238 (defun gnus-thread-sort-by-subject (h1 h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3239 "Sort threads by root subject."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3240 (gnus-article-sort-by-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3241 (gnus-thread-header h1) (gnus-thread-header h2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3242
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3243 (defsubst gnus-article-sort-by-date (h1 h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3244 "Sort articles by root article date."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3245 (gnus-time-less
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3246 (gnus-date-get-time (mail-header-date h1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3247 (gnus-date-get-time (mail-header-date h2))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3248
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3249 (defun gnus-thread-sort-by-date (h1 h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3250 "Sort threads by root article date."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3251 (gnus-article-sort-by-date
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3252 (gnus-thread-header h1) (gnus-thread-header h2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3253
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3254 (defsubst gnus-article-sort-by-score (h1 h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3255 "Sort articles by root article score.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3256 Unscored articles will be counted as having a score of zero."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3257 (> (or (cdr (assq (mail-header-number h1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3258 gnus-newsgroup-scored))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3259 gnus-summary-default-score 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3260 (or (cdr (assq (mail-header-number h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3261 gnus-newsgroup-scored))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3262 gnus-summary-default-score 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3263
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3264 (defun gnus-thread-sort-by-score (h1 h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3265 "Sort threads by root article score."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3266 (gnus-article-sort-by-score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3267 (gnus-thread-header h1) (gnus-thread-header h2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3268
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3269 (defun gnus-thread-sort-by-total-score (h1 h2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3270 "Sort threads by the sum of all scores in the thread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3271 Unscored articles will be counted as having a score of zero."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3272 (> (gnus-thread-total-score h1) (gnus-thread-total-score h2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3273
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3274 (defun gnus-thread-total-score (thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3275 ;; This function find the total score of THREAD.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3276 (cond ((null thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3277 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3278 ((consp thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3279 (if (stringp (car thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3280 (apply gnus-thread-score-function 0
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3281 (mapcar 'gnus-thread-total-score-1 (cdr thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3282 (gnus-thread-total-score-1 thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3283 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3284 (gnus-thread-total-score-1 (list thread)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3285
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3286 (defun gnus-thread-total-score-1 (root)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3287 ;; This function find the total score of the thread below ROOT.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3288 (setq root (car root))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3289 (apply gnus-thread-score-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3290 (or (append
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3291 (mapcar 'gnus-thread-total-score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3292 (cdr (gnus-gethash (mail-header-id root)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3293 gnus-newsgroup-dependencies)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3294 (when (> (mail-header-number root) 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3295 (list (or (cdr (assq (mail-header-number root)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3296 gnus-newsgroup-scored))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3297 gnus-summary-default-score 0))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3298 (list gnus-summary-default-score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3299 '(0))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3300
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3301 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3302 (defvar gnus-tmp-prev-subject nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3303 (defvar gnus-tmp-false-parent nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3304 (defvar gnus-tmp-root-expunged nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3305 (defvar gnus-tmp-dummy-line nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3306
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3307 (defun gnus-summary-prepare-threads (threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3308 "Prepare summary buffer from THREADS and indentation LEVEL.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3309 THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])'
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3310 or a straight list of headers."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3311 (gnus-message 7 "Generating summary...")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3312
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3313 (setq gnus-newsgroup-threads threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3314 (beginning-of-line)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3315
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3316 (let ((gnus-tmp-level 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3317 (default-score (or gnus-summary-default-score 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3318 (gnus-visual-p (gnus-visual-p 'summary-highlight 'highlight))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3319 thread number subject stack state gnus-tmp-gathered beg-match
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3320 new-roots gnus-tmp-new-adopts thread-end
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3321 gnus-tmp-header gnus-tmp-unread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3322 gnus-tmp-replied gnus-tmp-subject-or-nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3323 gnus-tmp-dummy gnus-tmp-indentation gnus-tmp-lines gnus-tmp-score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3324 gnus-tmp-score-char gnus-tmp-from gnus-tmp-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3325 gnus-tmp-number gnus-tmp-opening-bracket gnus-tmp-closing-bracket)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3326
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3327 (setq gnus-tmp-prev-subject nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3328
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3329 (if (vectorp (car threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3330 ;; If this is a straight (sic) list of headers, then a
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3331 ;; threaded summary display isn't required, so we just create
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3332 ;; an unthreaded one.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3333 (gnus-summary-prepare-unthreaded threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3334
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3335 ;; Do the threaded display.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3336
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3337 (while (or threads stack gnus-tmp-new-adopts new-roots)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3338
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3339 (if (and (= gnus-tmp-level 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3340 (not (setq gnus-tmp-dummy-line nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3341 (or (not stack)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3342 (= (caar stack) 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3343 (not gnus-tmp-false-parent)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3344 (or gnus-tmp-new-adopts new-roots))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3345 (if gnus-tmp-new-adopts
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3346 (setq gnus-tmp-level (if gnus-tmp-root-expunged 0 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3347 thread (list (car gnus-tmp-new-adopts))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3348 gnus-tmp-header (caar thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3349 gnus-tmp-new-adopts (cdr gnus-tmp-new-adopts))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3350 (when new-roots
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3351 (setq thread (list (car new-roots))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3352 gnus-tmp-header (caar thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3353 new-roots (cdr new-roots))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3354
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3355 (if threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3356 ;; If there are some threads, we do them before the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3357 ;; threads on the stack.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3358 (setq thread threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3359 gnus-tmp-header (caar thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3360 ;; There were no current threads, so we pop something off
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3361 ;; the stack.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3362 (setq state (car stack)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3363 gnus-tmp-level (car state)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3364 thread (cdr state)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3365 stack (cdr stack)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3366 gnus-tmp-header (caar thread))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3367
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3368 (setq gnus-tmp-false-parent nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3369 (setq gnus-tmp-root-expunged nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3370 (setq thread-end nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3371
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3372 (if (stringp gnus-tmp-header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3373 ;; The header is a dummy root.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3374 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3375 ((eq gnus-summary-make-false-root 'adopt)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3376 ;; We let the first article adopt the rest.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3377 (setq gnus-tmp-new-adopts (nconc gnus-tmp-new-adopts
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3378 (cddar thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3379 (setq gnus-tmp-gathered
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3380 (nconc (mapcar
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3381 (lambda (h) (mail-header-number (car h)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3382 (cddar thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3383 gnus-tmp-gathered))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3384 (setq thread (cons (list (caar thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3385 (cadar thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3386 (cdr thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3387 (setq gnus-tmp-level -1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3388 gnus-tmp-false-parent t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3389 ((eq gnus-summary-make-false-root 'empty)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3390 ;; We print adopted articles with empty subject fields.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3391 (setq gnus-tmp-gathered
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3392 (nconc (mapcar
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3393 (lambda (h) (mail-header-number (car h)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3394 (cddar thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3395 gnus-tmp-gathered))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3396 (setq gnus-tmp-level -1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3397 ((eq gnus-summary-make-false-root 'dummy)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3398 ;; We remember that we probably want to output a dummy
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3399 ;; root.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3400 (setq gnus-tmp-dummy-line gnus-tmp-header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3401 (setq gnus-tmp-prev-subject gnus-tmp-header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3402 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3403 ;; We do not make a root for the gathered
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3404 ;; sub-threads at all.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3405 (setq gnus-tmp-level -1)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3406
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3407 (setq number (mail-header-number gnus-tmp-header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3408 subject (mail-header-subject gnus-tmp-header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3409
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3410 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3411 ;; If the thread has changed subject, we might want to make
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3412 ;; this subthread into a root.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3413 ((and (null gnus-thread-ignore-subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3414 (not (zerop gnus-tmp-level))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3415 gnus-tmp-prev-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3416 (not (inline
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3417 (gnus-subject-equal gnus-tmp-prev-subject subject))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3418 (setq new-roots (nconc new-roots (list (car thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3419 thread-end t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3420 gnus-tmp-header nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3421 ;; If the article lies outside the current limit,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3422 ;; then we do not display it.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3423 ((not (memq number gnus-newsgroup-limit))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3424 (setq gnus-tmp-gathered
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3425 (nconc (mapcar
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3426 (lambda (h) (mail-header-number (car h)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3427 (cdar thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3428 gnus-tmp-gathered))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3429 (setq gnus-tmp-new-adopts (if (cdar thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3430 (append gnus-tmp-new-adopts
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3431 (cdar thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3432 gnus-tmp-new-adopts)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3433 thread-end t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3434 gnus-tmp-header nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3435 (when (zerop gnus-tmp-level)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3436 (setq gnus-tmp-root-expunged t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3437 ;; Perhaps this article is to be marked as read?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3438 ((and gnus-summary-mark-below
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3439 (< (or (cdr (assq number gnus-newsgroup-scored))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3440 default-score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3441 gnus-summary-mark-below)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3442 ;; Don't touch sparse articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3443 (not (gnus-summary-article-sparse-p number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3444 (not (gnus-summary-article-ancient-p number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3445 (setq gnus-newsgroup-unreads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3446 (delq number gnus-newsgroup-unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3447 (if gnus-newsgroup-auto-expire
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3448 (push number gnus-newsgroup-expirable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3449 (push (cons number gnus-low-score-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3450 gnus-newsgroup-reads))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3451
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3452 (when gnus-tmp-header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3453 ;; We may have an old dummy line to output before this
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3454 ;; article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3455 (when gnus-tmp-dummy-line
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3456 (gnus-summary-insert-dummy-line
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3457 gnus-tmp-dummy-line (mail-header-number gnus-tmp-header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3458 (setq gnus-tmp-dummy-line nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3459
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3460 ;; Compute the mark.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3461 (setq gnus-tmp-unread (gnus-article-mark number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3462
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3463 (push (gnus-data-make number gnus-tmp-unread (1+ (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3464 gnus-tmp-header gnus-tmp-level)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3465 gnus-newsgroup-data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3466
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3467 ;; Actually insert the line.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3468 (setq
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3469 gnus-tmp-subject-or-nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3470 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3471 ((and gnus-thread-ignore-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3472 gnus-tmp-prev-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3473 (not (inline (gnus-subject-equal
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3474 gnus-tmp-prev-subject subject))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3475 subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3476 ((zerop gnus-tmp-level)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3477 (if (and (eq gnus-summary-make-false-root 'empty)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3478 (memq number gnus-tmp-gathered)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3479 gnus-tmp-prev-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3480 (inline (gnus-subject-equal
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3481 gnus-tmp-prev-subject subject)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3482 gnus-summary-same-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3483 subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3484 (t gnus-summary-same-subject)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3485 (if (and (eq gnus-summary-make-false-root 'adopt)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3486 (= gnus-tmp-level 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3487 (memq number gnus-tmp-gathered))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3488 (setq gnus-tmp-opening-bracket ?\<
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3489 gnus-tmp-closing-bracket ?\>)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3490 (setq gnus-tmp-opening-bracket ?\[
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3491 gnus-tmp-closing-bracket ?\]))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3492 (setq
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3493 gnus-tmp-indentation
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3494 (aref gnus-thread-indent-array gnus-tmp-level)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3495 gnus-tmp-lines (mail-header-lines gnus-tmp-header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3496 gnus-tmp-score (or (cdr (assq number gnus-newsgroup-scored))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3497 gnus-summary-default-score 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3498 gnus-tmp-score-char
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3499 (if (or (null gnus-summary-default-score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3500 (<= (abs (- gnus-tmp-score gnus-summary-default-score))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3501 gnus-summary-zcore-fuzz))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3502 ?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3503 (if (< gnus-tmp-score gnus-summary-default-score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3504 gnus-score-below-mark gnus-score-over-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3505 gnus-tmp-replied
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3506 (cond ((memq number gnus-newsgroup-processable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3507 gnus-process-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3508 ((memq number gnus-newsgroup-cached)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3509 gnus-cached-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3510 ((memq number gnus-newsgroup-replied)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3511 gnus-replied-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3512 ((memq number gnus-newsgroup-saved)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3513 gnus-saved-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3514 (t gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3515 gnus-tmp-from (mail-header-from gnus-tmp-header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3516 gnus-tmp-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3517 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3518 ((string-match "<[^>]+> *$" gnus-tmp-from)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3519 (setq beg-match (match-beginning 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3520 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3521 (substring gnus-tmp-from (1+ (match-beginning 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3522 (1- (match-end 0))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3523 (substring gnus-tmp-from 0 beg-match)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3524 ((string-match "(.+)" gnus-tmp-from)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3525 (substring gnus-tmp-from
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3526 (1+ (match-beginning 0)) (1- (match-end 0))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3527 (t gnus-tmp-from)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3528 (when (string= gnus-tmp-name "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3529 (setq gnus-tmp-name gnus-tmp-from))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3530 (unless (numberp gnus-tmp-lines)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3531 (setq gnus-tmp-lines 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3532 (gnus-put-text-property
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3533 (point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3534 (progn (eval gnus-summary-line-format-spec) (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3535 'gnus-number number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3536 (when gnus-visual-p
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3537 (forward-line -1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3538 (run-hooks 'gnus-summary-update-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3539 (forward-line 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3540
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3541 (setq gnus-tmp-prev-subject subject)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3542
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3543 (when (nth 1 thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3544 (push (cons (max 0 gnus-tmp-level) (nthcdr 1 thread)) stack))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3545 (incf gnus-tmp-level)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3546 (setq threads (if thread-end nil (cdar thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3547 (unless threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3548 (setq gnus-tmp-level 0)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3549 (gnus-message 7 "Generating summary...done"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3550
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3551 (defun gnus-summary-prepare-unthreaded (headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3552 "Generate an unthreaded summary buffer based on HEADERS."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3553 (let (header number mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3554
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3555 (beginning-of-line)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3556
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3557 (while headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3558 ;; We may have to root out some bad articles...
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3559 (when (memq (setq number (mail-header-number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3560 (setq header (pop headers))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3561 gnus-newsgroup-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3562 ;; Mark article as read when it has a low score.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3563 (when (and gnus-summary-mark-below
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3564 (< (or (cdr (assq number gnus-newsgroup-scored))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3565 gnus-summary-default-score 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3566 gnus-summary-mark-below)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3567 (not (gnus-summary-article-ancient-p number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3568 (setq gnus-newsgroup-unreads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3569 (delq number gnus-newsgroup-unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3570 (if gnus-newsgroup-auto-expire
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3571 (push number gnus-newsgroup-expirable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3572 (push (cons number gnus-low-score-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3573 gnus-newsgroup-reads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3574
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3575 (setq mark (gnus-article-mark number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3576 (push (gnus-data-make number mark (1+ (point)) header 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3577 gnus-newsgroup-data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3578 (gnus-summary-insert-line
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3579 header 0 number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3580 mark (memq number gnus-newsgroup-replied)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3581 (memq number gnus-newsgroup-expirable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3582 (mail-header-subject header) nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3583 (cdr (assq number gnus-newsgroup-scored))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3584 (memq number gnus-newsgroup-processable))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3585
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3586 (defun gnus-select-newsgroup (group &optional read-all)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3587 "Select newsgroup GROUP.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3588 If READ-ALL is non-nil, all articles in the group are selected."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3589 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
3590 ;;!!! Dirty hack; should be removed.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
3591 (gnus-summary-ignore-duplicates
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
3592 (if (eq (car (gnus-find-method-for-group group)) 'nnvirtual)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
3593 t
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
3594 gnus-summary-ignore-duplicates))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3595 (info (nth 2 entry))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3596 articles fetched-articles cached)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3597
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3598 (unless (gnus-check-server
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
3599 (setq gnus-current-select-method
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3600 (gnus-find-method-for-group group)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3601 (error "Couldn't open server"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3602
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3603 (or (and entry (not (eq (car entry) t))) ; Either it's active...
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3604 (gnus-activate-group group) ; Or we can activate it...
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3605 (progn ; Or we bug out.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3606 (when (equal major-mode 'gnus-summary-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3607 (kill-buffer (current-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3608 (error "Couldn't request group %s: %s"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3609 group (gnus-status-message group))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3610
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3611 (unless (gnus-request-group group t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3612 (when (equal major-mode 'gnus-summary-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3613 (kill-buffer (current-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3614 (error "Couldn't request group %s: %s"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3615 group (gnus-status-message group)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3616
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3617 (setq gnus-newsgroup-name group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3618 (setq gnus-newsgroup-unselected nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3619 (setq gnus-newsgroup-unreads (gnus-list-of-unread-articles group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3620
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3621 ;; Adjust and set lists of article marks.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3622 (when info
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3623 (gnus-adjust-marked-articles info))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3624
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3625 ;; Kludge to avoid having cached articles nixed out in virtual groups.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3626 (when (gnus-virtual-group-p group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3627 (setq cached gnus-newsgroup-cached))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3628
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3629 (setq gnus-newsgroup-unreads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3630 (gnus-set-difference
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3631 (gnus-set-difference gnus-newsgroup-unreads gnus-newsgroup-marked)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3632 gnus-newsgroup-dormant))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3633
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3634 (setq gnus-newsgroup-processable nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3635
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3636 (gnus-update-read-articles group gnus-newsgroup-unreads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3637 (unless (gnus-ephemeral-group-p gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3638 (gnus-group-update-group group))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
3639
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3640 (setq articles (gnus-articles-to-read group read-all))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3641
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3642 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3643 ((null articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3644 ;;(gnus-message 3 "Couldn't select newsgroup -- no articles to display")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3645 'quit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3646 ((eq articles 0) nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3647 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3648 ;; Init the dependencies hash table.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3649 (setq gnus-newsgroup-dependencies
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3650 (gnus-make-hashtable (length articles)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3651 ;; Retrieve the headers and read them in.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3652 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3653 (setq gnus-newsgroup-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3654 (if (eq 'nov
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3655 (setq gnus-headers-retrieved-by
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3656 (gnus-retrieve-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3657 articles gnus-newsgroup-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3658 ;; We might want to fetch old headers, but
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3659 ;; not if there is only 1 article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3660 (and gnus-fetch-old-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3661 (or (and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3662 (not (eq gnus-fetch-old-headers 'some))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3663 (not (numberp gnus-fetch-old-headers)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3664 (> (length articles) 1))))))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
3665 (gnus-get-newsgroup-headers-xover
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3666 articles nil nil gnus-newsgroup-name t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3667 (gnus-get-newsgroup-headers)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3668 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3669
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3670 ;; Kludge to avoid having cached articles nixed out in virtual groups.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3671 (when cached
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3672 (setq gnus-newsgroup-cached cached))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3673
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3674 ;; Suppress duplicates?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3675 (when gnus-suppress-duplicates
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3676 (gnus-dup-suppress-articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3677
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3678 ;; Set the initial limit.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3679 (setq gnus-newsgroup-limit (copy-sequence articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3680 ;; Remove canceled articles from the list of unread articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3681 (setq gnus-newsgroup-unreads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3682 (gnus-set-sorted-intersection
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3683 gnus-newsgroup-unreads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3684 (setq fetched-articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3685 (mapcar (lambda (headers) (mail-header-number headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3686 gnus-newsgroup-headers))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3687 ;; Removed marked articles that do not exist.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3688 (gnus-update-missing-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3689 (gnus-sorted-complement fetched-articles articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3690 ;; We might want to build some more threads first.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3691 (and gnus-fetch-old-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3692 (eq gnus-headers-retrieved-by 'nov)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3693 (gnus-build-old-threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3694 ;; Check whether auto-expire is to be done in this group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3695 (setq gnus-newsgroup-auto-expire
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3696 (gnus-group-auto-expirable-p group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3697 ;; Set up the article buffer now, if necessary.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3698 (unless gnus-single-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3699 (gnus-article-setup-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3700 ;; First and last article in this newsgroup.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3701 (when gnus-newsgroup-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3702 (setq gnus-newsgroup-begin
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3703 (mail-header-number (car gnus-newsgroup-headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3704 gnus-newsgroup-end
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3705 (mail-header-number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3706 (gnus-last-element gnus-newsgroup-headers))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3707 ;; GROUP is successfully selected.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3708 (or gnus-newsgroup-headers t)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3709
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3710 (defun gnus-articles-to-read (group &optional read-all)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3711 ;; Find out what articles the user wants to read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3712 (let* ((articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3713 ;; Select all articles if `read-all' is non-nil, or if there
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3714 ;; are no unread articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3715 (if (or read-all
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3716 (and (zerop (length gnus-newsgroup-marked))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3717 (zerop (length gnus-newsgroup-unreads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3718 (eq (gnus-group-find-parameter group 'display)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3719 'all))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3720 (gnus-uncompress-range (gnus-active group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3721 (sort (append gnus-newsgroup-dormant gnus-newsgroup-marked
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3722 (copy-sequence gnus-newsgroup-unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3723 '<)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3724 (scored-list (gnus-killed-articles gnus-newsgroup-killed articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3725 (scored (length scored-list))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3726 (number (length articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3727 (marked (+ (length gnus-newsgroup-marked)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3728 (length gnus-newsgroup-dormant)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3729 (select
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3730 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3731 ((numberp read-all)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3732 read-all)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3733 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3734 (condition-case ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3735 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3736 ((and (or (<= scored marked) (= scored number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3737 (numberp gnus-large-newsgroup)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3738 (> number gnus-large-newsgroup))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3739 (let ((input
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3740 (read-string
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3741 (format
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3742 "How many articles from %s (default %d): "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3743 (gnus-limit-string gnus-newsgroup-name 35)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3744 number))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3745 (if (string-match "^[ \t]*$" input) number input)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3746 ((and (> scored marked) (< scored number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3747 (> (- scored number) 20))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3748 (let ((input
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3749 (read-string
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3750 (format "%s %s (%d scored, %d total): "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3751 "How many articles from"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3752 group scored number))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3753 (if (string-match "^[ \t]*$" input)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3754 number input)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3755 (t number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3756 (quit nil))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3757 (setq select (if (stringp select) (string-to-number select) select))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3758 (if (or (null select) (zerop select))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3759 select
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3760 (if (and (not (zerop scored)) (<= (abs select) scored))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3761 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3762 (setq articles (sort scored-list '<))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3763 (setq number (length articles)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3764 (setq articles (copy-sequence articles)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3765
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3766 (when (< (abs select) number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3767 (if (< select 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3768 ;; Select the N oldest articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3769 (setcdr (nthcdr (1- (abs select)) articles) nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3770 ;; Select the N most recent articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3771 (setq articles (nthcdr (- number select) articles))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3772 (setq gnus-newsgroup-unselected
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3773 (gnus-sorted-intersection
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3774 gnus-newsgroup-unreads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3775 (gnus-sorted-complement gnus-newsgroup-unreads articles)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3776 articles)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3777
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3778 (defun gnus-killed-articles (killed articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3779 (let (out)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3780 (while articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3781 (when (inline (gnus-member-of-range (car articles) killed))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3782 (push (car articles) out))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3783 (setq articles (cdr articles)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3784 out))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3785
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3786 (defun gnus-uncompress-marks (marks)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3787 "Uncompress the mark ranges in MARKS."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3788 (let ((uncompressed '(score bookmark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3789 out)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3790 (while marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3791 (if (memq (caar marks) uncompressed)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3792 (push (car marks) out)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3793 (push (cons (caar marks) (gnus-uncompress-range (cdar marks))) out))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3794 (setq marks (cdr marks)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3795 out))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3796
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3797 (defun gnus-adjust-marked-articles (info)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3798 "Set all article lists and remove all marks that are no longer legal."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3799 (let* ((marked-lists (gnus-info-marks info))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3800 (active (gnus-active (gnus-info-group info)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3801 (min (car active))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3802 (max (cdr active))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3803 (types gnus-article-mark-lists)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3804 (uncompressed '(score bookmark killed))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3805 marks var articles article mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3806
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3807 (while marked-lists
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3808 (setq marks (pop marked-lists))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3809 (set (setq var (intern (format "gnus-newsgroup-%s"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3810 (car (rassq (setq mark (car marks))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3811 types)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3812 (if (memq (car marks) uncompressed) (cdr marks)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3813 (gnus-uncompress-range (cdr marks))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3814
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3815 (setq articles (symbol-value var))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3816
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3817 ;; All articles have to be subsets of the active articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3818 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3819 ;; Adjust "simple" lists.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3820 ((memq mark '(tick dormant expirable reply save))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3821 (while articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3822 (when (or (< (setq article (pop articles)) min) (> article max))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3823 (set var (delq article (symbol-value var))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3824 ;; Adjust assocs.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3825 ((memq mark uncompressed)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3826 (while articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3827 (when (or (not (consp (setq article (pop articles))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3828 (< (car article) min)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3829 (> (car article) max))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3830 (set var (delq article (symbol-value var))))))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3831
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3832 (defun gnus-update-missing-marks (missing)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3833 "Go through the list of MISSING articles and remove them mark lists."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3834 (when missing
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3835 (let ((types gnus-article-mark-lists)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3836 var m)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3837 ;; Go through all types.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3838 (while types
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3839 (setq var (intern (format "gnus-newsgroup-%s" (car (pop types)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3840 (when (symbol-value var)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3841 ;; This list has articles. So we delete all missing articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3842 ;; from it.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3843 (setq m missing)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3844 (while m
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3845 (set var (delq (pop m) (symbol-value var)))))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3846
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3847 (defun gnus-update-marks ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3848 "Enter the various lists of marked articles into the newsgroup info list."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3849 (let ((types gnus-article-mark-lists)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3850 (info (gnus-get-info gnus-newsgroup-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3851 (uncompressed '(score bookmark killed))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3852 type list newmarked symbol)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3853 (when info
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3854 ;; Add all marks lists that are non-nil to the list of marks lists.
112
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3855 (while (setq type (pop types))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3856 (when (setq list (symbol-value
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3857 (setq symbol
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3858 (intern (format "gnus-newsgroup-%s"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3859 (car type))))))
112
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3860
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3861 ;; Get rid of the entries of the articles that have the
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3862 ;; default score.
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3863 (when (and (eq (cdr type) 'score)
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3864 gnus-save-score
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3865 list)
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3866 (let* ((arts list)
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
3867 (prev (cons nil list))
112
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3868 (all prev))
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3869 (while arts
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3870 (if (or (not (consp (car arts)))
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3871 (= (cdar arts) gnus-summary-default-score))
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3872 (setcdr prev (cdr arts))
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3873 (setq prev arts))
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3874 (setq arts (cdr arts)))
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3875 (setq list (cdr all))))
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
3876
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3877 (push (cons (cdr type)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3878 (if (memq (cdr type) uncompressed) list
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
3879 (gnus-compress-sequence
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3880 (set symbol (sort list '<)) t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3881 newmarked)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3882
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3883 ;; Enter these new marks into the info of the group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3884 (if (nthcdr 3 info)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3885 (setcar (nthcdr 3 info) newmarked)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3886 ;; Add the marks lists to the end of the info.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3887 (when newmarked
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3888 (setcdr (nthcdr 2 info) (list newmarked))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3889
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3890 ;; Cut off the end of the info if there's nothing else there.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3891 (let ((i 5))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3892 (while (and (> i 2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3893 (not (nth i info)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3894 (when (nthcdr (decf i) info)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3895 (setcdr (nthcdr i info) nil)))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3896
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3897 (defun gnus-set-mode-line (where)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3898 "This function sets the mode line of the article or summary buffers.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3899 If WHERE is `summary', the summary mode line format will be used."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3900 ;; Is this mode line one we keep updated?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3901 (when (memq where gnus-updated-mode-lines)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3902 (let (mode-string)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3903 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3904 ;; We evaluate this in the summary buffer since these
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3905 ;; variables are buffer-local to that buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3906 (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3907 ;; We bind all these variables that are used in the `eval' form
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3908 ;; below.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3909 (let* ((mformat (symbol-value
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3910 (intern
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3911 (format "gnus-%s-mode-line-format-spec" where))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3912 (gnus-tmp-group-name gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3913 (gnus-tmp-article-number (or gnus-current-article 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3914 (gnus-tmp-unread gnus-newsgroup-unreads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3915 (gnus-tmp-unread-and-unticked (length gnus-newsgroup-unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3916 (gnus-tmp-unselected (length gnus-newsgroup-unselected))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3917 (gnus-tmp-unread-and-unselected
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3918 (cond ((and (zerop gnus-tmp-unread-and-unticked)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3919 (zerop gnus-tmp-unselected))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3920 "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3921 ((zerop gnus-tmp-unselected)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3922 (format "{%d more}" gnus-tmp-unread-and-unticked))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3923 (t (format "{%d(+%d) more}"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3924 gnus-tmp-unread-and-unticked
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3925 gnus-tmp-unselected))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3926 (gnus-tmp-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3927 (if (and gnus-current-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3928 (vectorp gnus-current-headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3929 (gnus-mode-string-quote
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3930 (mail-header-subject gnus-current-headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3931 ""))
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
3932 bufname-length max-len
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3933 gnus-tmp-header);; passed as argument to any user-format-funcs
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3934 (setq mode-string (eval mformat))
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
3935 (setq bufname-length (if (string-match "%b" mode-string)
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
3936 (- (length
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
3937 (buffer-name
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
3938 (if (eq where 'summary)
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
3939 nil
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
3940 (get-buffer gnus-article-buffer))))
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
3941 2)
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
3942 0))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3943 (setq max-len (max 4 (if gnus-mode-non-string-length
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3944 (- (window-width)
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
3945 gnus-mode-non-string-length
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
3946 bufname-length)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3947 (length mode-string))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3948 ;; We might have to chop a bit of the string off...
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3949 (when (> (length mode-string) max-len)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3950 (setq mode-string
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3951 (concat (gnus-truncate-string mode-string (- max-len 3))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3952 "...")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3953 ;; Pad the mode string a bit.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3954 (setq mode-string (format (format "%%-%ds" max-len) mode-string))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3955 ;; Update the mode line.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
3956 (setq mode-line-buffer-identification
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
3957 (gnus-mode-line-buffer-identification (list mode-string)))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3958 (set-buffer-modified-p t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3959
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3960 (defun gnus-create-xref-hashtb (from-newsgroup headers unreads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3961 "Go through the HEADERS list and add all Xrefs to a hash table.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3962 The resulting hash table is returned, or nil if no Xrefs were found."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3963 (let* ((virtual (gnus-virtual-group-p from-newsgroup))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3964 (prefix (if virtual "" (gnus-group-real-prefix from-newsgroup)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3965 (xref-hashtb (gnus-make-hashtable))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3966 start group entry number xrefs header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3967 (while headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3968 (setq header (pop headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3969 (when (and (setq xrefs (mail-header-xref header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3970 (not (memq (setq number (mail-header-number header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3971 unreads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3972 (setq start 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3973 (while (string-match "\\([^ ]+\\)[:/]\\([0-9]+\\)" xrefs start)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3974 (setq start (match-end 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3975 (setq group (if prefix
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3976 (concat prefix (substring xrefs (match-beginning 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3977 (match-end 1)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3978 (substring xrefs (match-beginning 1) (match-end 1))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3979 (setq number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3980 (string-to-int (substring xrefs (match-beginning 2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3981 (match-end 2))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3982 (if (setq entry (gnus-gethash group xref-hashtb))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3983 (setcdr entry (cons number (cdr entry)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3984 (gnus-sethash group (cons number nil) xref-hashtb)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3985 (and start xref-hashtb)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3986
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3987 (defun gnus-mark-xrefs-as-read (from-newsgroup headers unreads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3988 "Look through all the headers and mark the Xrefs as read."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3989 (let ((virtual (gnus-virtual-group-p from-newsgroup))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3990 name entry info xref-hashtb idlist method nth4)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3991 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3992 (set-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3993 (when (setq xref-hashtb
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3994 (gnus-create-xref-hashtb from-newsgroup headers unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3995 (mapatoms
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3996 (lambda (group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3997 (unless (string= from-newsgroup (setq name (symbol-name group)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3998 (setq idlist (symbol-value group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
3999 ;; Dead groups are not updated.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4000 (and (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4001 (setq entry (gnus-gethash name gnus-newsrc-hashtb)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4002 info (nth 2 entry))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4003 (when (stringp (setq nth4 (gnus-info-method info)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4004 (setq nth4 (gnus-server-to-method nth4))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4005 ;; Only do the xrefs if the group has the same
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4006 ;; select method as the group we have just read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4007 (or (gnus-methods-equal-p
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4008 nth4 (gnus-find-method-for-group from-newsgroup))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4009 virtual
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4010 (equal nth4 (setq method (gnus-find-method-for-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4011 from-newsgroup)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4012 (and (equal (car nth4) (car method))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4013 (equal (nth 1 nth4) (nth 1 method))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4014 gnus-use-cross-reference
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4015 (or (not (eq gnus-use-cross-reference t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4016 virtual
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4017 ;; Only do cross-references on subscribed
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4018 ;; groups, if that is what is wanted.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4019 (<= (gnus-info-level info) gnus-level-subscribed))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4020 (gnus-group-make-articles-read name idlist))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4021 xref-hashtb)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4022
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4023 (defun gnus-group-make-articles-read (group articles)
112
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
4024 "Update the info of GROUP to say that ARTICLES are read."
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4025 (let* ((num 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4026 (entry (gnus-gethash group gnus-newsrc-hashtb))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4027 (info (nth 2 entry))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4028 (active (gnus-active group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4029 range)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4030 ;; First peel off all illegal article numbers.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4031 (when active
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4032 (let ((ids articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4033 id first)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4034 (while (setq id (pop ids))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4035 (when (and first (> id (cdr active)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4036 ;; We'll end up in this situation in one particular
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4037 ;; obscure situation. If you re-scan a group and get
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4038 ;; a new article that is cross-posted to a different
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4039 ;; group that has not been re-scanned, you might get
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4040 ;; crossposted article that has a higher number than
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4041 ;; Gnus believes possible. So we re-activate this
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4042 ;; group as well. This might mean doing the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4043 ;; crossposting thingy will *increase* the number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4044 ;; of articles in some groups. Tsk, tsk.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4045 (setq active (or (gnus-activate-group group) active)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4046 (when (or (> id (cdr active))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4047 (< id (car active)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4048 (setq articles (delq id articles))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4049 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4050 (set-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4051 (gnus-undo-register
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4052 `(progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4053 (gnus-info-set-marks ',info ',(gnus-info-marks info) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4054 (gnus-info-set-read ',info ',(gnus-info-read info))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4055 (gnus-get-unread-articles-in-group ',info (gnus-active ,group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4056 (gnus-group-update-group ,group t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4057 ;; If the read list is nil, we init it.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4058 (and active
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4059 (null (gnus-info-read info))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4060 (> (car active) 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4061 (gnus-info-set-read info (cons 1 (1- (car active)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4062 ;; Then we add the read articles to the range.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4063 (gnus-info-set-read
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4064 info
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4065 (setq range
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4066 (gnus-add-to-range
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4067 (gnus-info-read info) (setq articles (sort articles '<)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4068 ;; Then we have to re-compute how many unread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4069 ;; articles there are in this group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4070 (when active
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4071 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4072 ((not range)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4073 (setq num (- (1+ (cdr active)) (car active))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4074 ((not (listp (cdr range)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4075 (setq num (- (cdr active) (- (1+ (cdr range))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4076 (car range)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4077 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4078 (while range
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4079 (if (numberp (car range))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4080 (setq num (1+ num))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4081 (setq num (+ num (- (1+ (cdar range)) (caar range)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4082 (setq range (cdr range)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4083 (setq num (- (cdr active) num))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4084 ;; Update the number of unread articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4085 (setcar entry num)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4086 ;; Update the group buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4087 (gnus-group-update-group group t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4088
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4089 (defun gnus-methods-equal-p (m1 m2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4090 (let ((m1 (or m1 gnus-select-method))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4091 (m2 (or m2 gnus-select-method)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4092 (or (equal m1 m2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4093 (and (eq (car m1) (car m2))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4094 (or (not (memq 'address (assoc (symbol-name (car m1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4095 gnus-valid-select-methods)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4096 (equal (nth 1 m1) (nth 1 m2)))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4097
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4098 (defvar gnus-newsgroup-none-id 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4099
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4100 (defun gnus-get-newsgroup-headers (&optional dependencies force-new)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4101 (let ((cur nntp-server-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4102 (dependencies
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4103 (or dependencies
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4104 (save-excursion (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4105 gnus-newsgroup-dependencies)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4106 headers id id-dep ref-dep end ref)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4107 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4108 (set-buffer nntp-server-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4109 ;; Translate all TAB characters into SPACE characters.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4110 (subst-char-in-region (point-min) (point-max) ?\t ? t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4111 (run-hooks 'gnus-parse-headers-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4112 (let ((case-fold-search t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4113 in-reply-to header p lines)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4114 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4115 ;; Search to the beginning of the next header. Error messages
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4116 ;; do not begin with 2 or 3.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4117 (while (re-search-forward "^[23][0-9]+ " nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4118 (setq id nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4119 ref nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4120 ;; This implementation of this function, with nine
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4121 ;; search-forwards instead of the one re-search-forward and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4122 ;; a case (which basically was the old function) is actually
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4123 ;; about twice as fast, even though it looks messier. You
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4124 ;; can't have everything, I guess. Speed and elegance
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4125 ;; doesn't always go hand in hand.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4126 (setq
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4127 header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4128 (vector
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4129 ;; Number.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4130 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4131 (read cur)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4132 (end-of-line)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4133 (setq p (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4134 (narrow-to-region (point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4135 (or (and (search-forward "\n.\n" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4136 (- (point) 2))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4137 (point))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4138 ;; Subject.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4139 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4140 (goto-char p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4141 (if (search-forward "\nsubject: " nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4142 (nnheader-header-value) "(none)"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4143 ;; From.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4144 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4145 (goto-char p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4146 (if (search-forward "\nfrom: " nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4147 (nnheader-header-value) "(nobody)"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4148 ;; Date.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4149 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4150 (goto-char p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4151 (if (search-forward "\ndate: " nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4152 (nnheader-header-value) ""))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4153 ;; Message-ID.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4154 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4155 (goto-char p)
112
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
4156 (setq id (if (search-forward "\nmessage-id:" nil t)
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
4157 (buffer-substring
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
4158 (1- (or (search-forward "<" nil t) (point)))
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
4159 (or (search-forward ">" nil t) (point)))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4160 ;; If there was no message-id, we just fake one
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4161 ;; to make subsequent routines simpler.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4162 (nnheader-generate-fake-message-id))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4163 ;; References.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4164 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4165 (goto-char p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4166 (if (search-forward "\nreferences: " nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4167 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4168 (setq end (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4169 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4170 (nnheader-header-value)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4171 (setq ref
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4172 (buffer-substring
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4173 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4174 (end-of-line)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4175 (search-backward ">" end t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4176 (1+ (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4177 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4178 (search-backward "<" end t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4179 (point))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4180 ;; Get the references from the in-reply-to header if there
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4181 ;; were no references and the in-reply-to header looks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4182 ;; promising.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4183 (if (and (search-forward "\nin-reply-to: " nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4184 (setq in-reply-to (nnheader-header-value))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4185 (string-match "<[^>]+>" in-reply-to))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4186 (setq ref (substring in-reply-to (match-beginning 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4187 (match-end 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4188 (setq ref nil))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4189 ;; Chars.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4190 0
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4191 ;; Lines.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4192 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4193 (goto-char p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4194 (if (search-forward "\nlines: " nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4195 (if (numberp (setq lines (read cur)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4196 lines 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4197 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4198 ;; Xref.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4199 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4200 (goto-char p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4201 (and (search-forward "\nxref: " nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4202 (nnheader-header-value)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4203 (when (equal id ref)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4204 (setq ref nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4205 ;; We do the threading while we read the headers. The
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4206 ;; message-id and the last reference are both entered into
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4207 ;; the same hash table. Some tippy-toeing around has to be
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4208 ;; done in case an article has arrived before the article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4209 ;; which it refers to.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4210 (if (boundp (setq id-dep (intern id dependencies)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4211 (if (and (car (symbol-value id-dep))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4212 (not force-new))
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4213 ;; An article with this Message-ID has already been seen.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4214 (if gnus-summary-ignore-duplicates
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4215 ;; We ignore this one, except we add
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4216 ;; any additional Xrefs (in case the two articles
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4217 ;; came from different servers).
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4218 (progn
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4219 (mail-header-set-xref
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4220 (car (symbol-value id-dep))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4221 (concat (or (mail-header-xref
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4222 (car (symbol-value id-dep)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4223 "")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4224 (or (mail-header-xref header) "")))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4225 (setq header nil))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4226 ;; We rename the Message-ID.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4227 (set
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4228 (setq id-dep (intern (setq id (nnmail-message-id))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4229 dependencies))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4230 (list header))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4231 (mail-header-set-id header id))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4232 (setcar (symbol-value id-dep) header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4233 (set id-dep (list header)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4234 (when header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4235 (if (boundp (setq ref-dep (intern (or ref "none") dependencies)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4236 (setcdr (symbol-value ref-dep)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4237 (nconc (cdr (symbol-value ref-dep))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4238 (list (symbol-value id-dep))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4239 (set ref-dep (list nil (symbol-value id-dep))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4240 (push header headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4241 (goto-char (point-max))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4242 (widen))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4243 (nreverse headers)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4244
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4245 ;; The following macros and functions were written by Felix Lee
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4246 ;; <flee@cse.psu.edu>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4247
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4248 (defmacro gnus-nov-read-integer ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4249 '(prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4250 (if (= (following-char) ?\t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4251 0
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4252 (let ((num (ignore-errors (read buffer))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4253 (if (numberp num) num 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4254 (unless (eobp)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4255 (forward-char 1))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4256
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4257 (defmacro gnus-nov-skip-field ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4258 '(search-forward "\t" eol 'move))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4259
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4260 (defmacro gnus-nov-field ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4261 '(buffer-substring (point) (if (gnus-nov-skip-field) (1- (point)) eol)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4262
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4263 ;; (defvar gnus-nov-none-counter 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4264
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4265 ;; This function has to be called with point after the article number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4266 ;; on the beginning of the line.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4267 (defun gnus-nov-parse-line (number dependencies &optional force-new)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4268 (let ((eol (gnus-point-at-eol))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4269 (buffer (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4270 header ref id id-dep ref-dep)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4271
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4272 ;; overview: [num subject from date id refs chars lines misc]
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4273 (unwind-protect
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4274 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4275 (narrow-to-region (point) eol)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4276 (unless (eobp)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4277 (forward-char))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4278
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4279 (setq header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4280 (vector
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4281 number ; number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4282 (gnus-nov-field) ; subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4283 (gnus-nov-field) ; from
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4284 (gnus-nov-field) ; date
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4285 (setq id (or (gnus-nov-field)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4286 (nnheader-generate-fake-message-id))) ; id
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4287 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4288 (let ((beg (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4289 (search-forward "\t" eol)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4290 (if (search-backward ">" beg t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4291 (setq ref
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4292 (buffer-substring
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4293 (1+ (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4294 (search-backward "<" beg t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4295 (setq ref nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4296 (goto-char beg))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4297 (gnus-nov-field)) ; refs
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4298 (gnus-nov-read-integer) ; chars
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4299 (gnus-nov-read-integer) ; lines
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4300 (if (= (following-char) ?\n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4301 nil
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4302 (gnus-nov-field))))) ; misc
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4303
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4304 (widen))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4305
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4306 ;; We build the thread tree.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4307 (when (equal id ref)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4308 ;; This article refers back to itself. Naughty, naughty.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4309 (setq ref nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4310 (if (boundp (setq id-dep (intern id dependencies)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4311 (if (and (car (symbol-value id-dep))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4312 (not force-new))
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4313 ;; An article with this Message-ID has already been seen.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4314 (if gnus-summary-ignore-duplicates
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4315 ;; We ignore this one, except we add any additional
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4316 ;; Xrefs (in case the two articles came from different
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4317 ;; servers.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4318 (progn
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4319 (mail-header-set-xref
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4320 (car (symbol-value id-dep))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4321 (concat (or (mail-header-xref
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4322 (car (symbol-value id-dep)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4323 "")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4324 (or (mail-header-xref header) "")))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4325 (setq header nil))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 112
diff changeset
4326 ;; We rename the Message-ID.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4327 (set
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4328 (setq id-dep (intern (setq id (nnmail-message-id))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4329 dependencies))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4330 (list header))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4331 (mail-header-set-id header id))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4332 (setcar (symbol-value id-dep) header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4333 (set id-dep (list header)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4334 (when header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4335 (if (boundp (setq ref-dep (intern (or ref "none") dependencies)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4336 (setcdr (symbol-value ref-dep)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4337 (nconc (cdr (symbol-value ref-dep))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4338 (list (symbol-value id-dep))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4339 (set ref-dep (list nil (symbol-value id-dep)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4340 header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4341
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4342 ;; Goes through the xover lines and returns a list of vectors
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4343 (defun gnus-get-newsgroup-headers-xover (sequence &optional
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4344 force-new dependencies
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4345 group also-fetch-heads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4346 "Parse the news overview data in the server buffer, and return a
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4347 list of headers that match SEQUENCE (see `nntp-retrieve-headers')."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4348 ;; Get the Xref when the users reads the articles since most/some
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4349 ;; NNTP servers do not include Xrefs when using XOVER.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4350 (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4351 (let ((cur nntp-server-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4352 (dependencies (or dependencies gnus-newsgroup-dependencies))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4353 number headers header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4354 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4355 (set-buffer nntp-server-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4356 ;; Allow the user to mangle the headers before parsing them.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4357 (run-hooks 'gnus-parse-headers-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4358 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4359 (while (not (eobp))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4360 (condition-case ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4361 (while (and sequence (not (eobp)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4362 (setq number (read cur))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4363 (while (and sequence
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4364 (< (car sequence) number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4365 (setq sequence (cdr sequence)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4366 (and sequence
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4367 (eq number (car sequence))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4368 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4369 (setq sequence (cdr sequence))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4370 (setq header (inline
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4371 (gnus-nov-parse-line
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4372 number dependencies force-new))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4373 (push header headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4374 (forward-line 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4375 (error
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4376 (gnus-error 4 "Strange nov line (%d)"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4377 (count-lines (point-min) (point)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4378 (forward-line 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4379 ;; A common bug in inn is that if you have posted an article and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4380 ;; then retrieves the active file, it will answer correctly --
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4381 ;; the new article is included. However, a NOV entry for the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4382 ;; article may not have been generated yet, so this may fail.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4383 ;; We work around this problem by retrieving the last few
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4384 ;; headers using HEAD.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4385 (if (or (not also-fetch-heads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4386 (not sequence))
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
4387 ;; We (probably) got all the headers.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4388 (nreverse headers)
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
4389 (let ((gnus-nov-is-evil t))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4390 (nconc
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4391 (nreverse headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4392 (when (gnus-retrieve-headers sequence group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4393 (gnus-get-newsgroup-headers))))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4394
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4395 (defun gnus-article-get-xrefs ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4396 "Fill in the Xref value in `gnus-current-headers', if necessary.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4397 This is meant to be called in `gnus-article-internal-prepare-hook'."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4398 (let ((headers (save-excursion (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4399 gnus-current-headers)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4400 (or (not gnus-use-cross-reference)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4401 (not headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4402 (and (mail-header-xref headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4403 (not (string= (mail-header-xref headers) "")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4404 (let ((case-fold-search t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4405 xref)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4406 (save-restriction
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4407 (nnheader-narrow-to-headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4408 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4409 (when (or (and (eq (downcase (following-char)) ?x)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4410 (looking-at "Xref:"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4411 (search-forward "\nXref:" nil t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4412 (goto-char (1+ (match-end 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4413 (setq xref (buffer-substring (point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4414 (progn (end-of-line) (point))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4415 (mail-header-set-xref headers xref)))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4416
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4417 (defun gnus-summary-insert-subject (id &optional old-header use-old-header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4418 "Find article ID and insert the summary line for that article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4419 (let ((header (if (and old-header use-old-header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4420 old-header (gnus-read-header id)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4421 (number (and (numberp id) id))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4422 pos d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4423 (when header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4424 ;; Rebuild the thread that this article is part of and go to the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4425 ;; article we have fetched.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4426 (when (and (not gnus-show-threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4427 old-header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4428 (when (setq d (gnus-data-find (mail-header-number old-header)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4429 (goto-char (gnus-data-pos d))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4430 (gnus-data-remove
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4431 number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4432 (- (gnus-point-at-bol)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4433 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4434 (1+ (gnus-point-at-eol))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4435 (gnus-delete-line))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4436 (when old-header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4437 (mail-header-set-number header (mail-header-number old-header)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4438 (setq gnus-newsgroup-sparse
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4439 (delq (setq number (mail-header-number header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4440 gnus-newsgroup-sparse))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4441 (setq gnus-newsgroup-ancient (delq number gnus-newsgroup-ancient))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4442 (gnus-rebuild-thread (mail-header-id header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4443 (gnus-summary-goto-subject number nil t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4444 (when (and (numberp number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4445 (> number 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4446 ;; We have to update the boundaries even if we can't fetch the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4447 ;; article if ID is a number -- so that the next `P' or `N'
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4448 ;; command will fetch the previous (or next) article even
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4449 ;; if the one we tried to fetch this time has been canceled.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4450 (when (> number gnus-newsgroup-end)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4451 (setq gnus-newsgroup-end number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4452 (when (< number gnus-newsgroup-begin)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4453 (setq gnus-newsgroup-begin number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4454 (setq gnus-newsgroup-unselected
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4455 (delq number gnus-newsgroup-unselected)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4456 ;; Report back a success?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4457 (and header (mail-header-number header))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4458
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4459 ;;; Process/prefix in the summary buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4460
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4461 (defun gnus-summary-work-articles (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4462 "Return a list of articles to be worked upon. The prefix argument,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4463 the list of process marked articles, and the current article will be
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4464 taken into consideration."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4465 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4466 (n
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4467 ;; A numerical prefix has been given.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4468 (setq n (prefix-numeric-value n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4469 (let ((backward (< n 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4470 (n (abs (prefix-numeric-value n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4471 articles article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4472 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4473 (while
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4474 (and (> n 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4475 (push (setq article (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4476 articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4477 (if backward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4478 (gnus-summary-find-prev nil article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4479 (gnus-summary-find-next nil article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4480 (decf n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4481 (nreverse articles)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4482 ((gnus-region-active-p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4483 ;; Work on the region between point and mark.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4484 (let ((max (max (point) (mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4485 articles article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4486 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4487 (goto-char (min (point) (mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4488 (while
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4489 (and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4490 (push (setq article (gnus-summary-article-number)) articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4491 (gnus-summary-find-next nil article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4492 (< (point) max)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4493 (nreverse articles))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4494 (gnus-newsgroup-processable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4495 ;; There are process-marked articles present.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4496 ;; Save current state.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4497 (gnus-summary-save-process-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4498 ;; Return the list.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4499 (reverse gnus-newsgroup-processable))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4500 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4501 ;; Just return the current article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4502 (list (gnus-summary-article-number)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4503
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4504 (defun gnus-summary-save-process-mark ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4505 "Push the current set of process marked articles on the stack."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4506 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4507 (push (copy-sequence gnus-newsgroup-processable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4508 gnus-newsgroup-process-stack))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4509
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4510 (defun gnus-summary-kill-process-mark ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4511 "Push the current set of process marked articles on the stack and unmark."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4512 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4513 (gnus-summary-save-process-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4514 (gnus-summary-unmark-all-processable))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4515
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4516 (defun gnus-summary-yank-process-mark ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4517 "Pop the last process mark state off the stack and restore it."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4518 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4519 (unless gnus-newsgroup-process-stack
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4520 (error "Empty mark stack"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4521 (gnus-summary-process-mark-set (pop gnus-newsgroup-process-stack)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4522
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4523 (defun gnus-summary-process-mark-set (set)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4524 "Make SET into the current process marked articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4525 (gnus-summary-unmark-all-processable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4526 (while set
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4527 (gnus-summary-set-process-mark (pop set))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4528
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4529 ;;; Searching and stuff
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4530
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4531 (defun gnus-summary-search-group (&optional backward use-level)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4532 "Search for next unread newsgroup.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4533 If optional argument BACKWARD is non-nil, search backward instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4534 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4535 (set-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4536 (when (gnus-group-search-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4537 backward nil (if use-level (gnus-group-group-level) nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4538 (gnus-group-group-name))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4539
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4540 (defun gnus-summary-best-group (&optional exclude-group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4541 "Find the name of the best unread group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4542 If EXCLUDE-GROUP, do not go to this group."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4543 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4544 (set-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4545 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4546 (gnus-group-best-unread-group exclude-group))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4547
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4548 (defun gnus-summary-find-next (&optional unread article backward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4549 (if backward (gnus-summary-find-prev)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4550 (let* ((dummy (gnus-summary-article-intangible-p))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4551 (article (or article (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4552 (arts (gnus-data-find-list article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4553 result)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4554 (when (and (not dummy)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4555 (or (not gnus-summary-check-current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4556 (not unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4557 (not (gnus-data-unread-p (car arts)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4558 (setq arts (cdr arts)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4559 (when (setq result
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4560 (if unread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4561 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4562 (while arts
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4563 (when (gnus-data-unread-p (car arts))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4564 (setq result (car arts)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4565 arts nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4566 (setq arts (cdr arts)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4567 result)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4568 (car arts)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4569 (goto-char (gnus-data-pos result))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4570 (gnus-data-number result)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4571
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4572 (defun gnus-summary-find-prev (&optional unread article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4573 (let* ((eobp (eobp))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4574 (article (or article (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4575 (arts (gnus-data-find-list article (gnus-data-list 'rev)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4576 result)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4577 (when (and (not eobp)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4578 (or (not gnus-summary-check-current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4579 (not unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4580 (not (gnus-data-unread-p (car arts)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4581 (setq arts (cdr arts)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4582 (when (setq result
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4583 (if unread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4584 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4585 (while arts
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4586 (when (gnus-data-unread-p (car arts))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4587 (setq result (car arts)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4588 arts nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4589 (setq arts (cdr arts)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4590 result)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4591 (car arts)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4592 (goto-char (gnus-data-pos result))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4593 (gnus-data-number result))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4594
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4595 (defun gnus-summary-find-subject (subject &optional unread backward article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4596 (let* ((simp-subject (gnus-simplify-subject-fully subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4597 (article (or article (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4598 (articles (gnus-data-list backward))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4599 (arts (gnus-data-find-list article articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4600 result)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4601 (when (or (not gnus-summary-check-current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4602 (not unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4603 (not (gnus-data-unread-p (car arts))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4604 (setq arts (cdr arts)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4605 (while arts
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4606 (and (or (not unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4607 (gnus-data-unread-p (car arts)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4608 (vectorp (gnus-data-header (car arts)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4609 (gnus-subject-equal
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4610 simp-subject (mail-header-subject (gnus-data-header (car arts))) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4611 (setq result (car arts)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4612 arts nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4613 (setq arts (cdr arts)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4614 (and result
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4615 (goto-char (gnus-data-pos result))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4616 (gnus-data-number result))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4617
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4618 (defun gnus-summary-search-forward (&optional unread subject backward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4619 "Search forward for an article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4620 If UNREAD, look for unread articles. If SUBJECT, look for
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4621 articles with that subject. If BACKWARD, search backward instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4622 (cond (subject (gnus-summary-find-subject subject unread backward))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4623 (backward (gnus-summary-find-prev unread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4624 (t (gnus-summary-find-next unread))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4625
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4626 (defun gnus-recenter (&optional n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4627 "Center point in window and redisplay frame.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4628 Also do horizontal recentering."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4629 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4630 (when (and gnus-auto-center-summary
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4631 (not (eq gnus-auto-center-summary 'vertical)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4632 (gnus-horizontal-recenter))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4633 (recenter n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4634
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4635 (defun gnus-summary-recenter ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4636 "Center point in the summary window.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4637 If `gnus-auto-center-summary' is nil, or the article buffer isn't
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4638 displayed, no centering will be performed."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4639 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle).
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4640 ;; Recenter only when requested. Suggested by popovich@park.cs.columbia.edu.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4641 (let* ((top (cond ((< (window-height) 4) 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4642 ((< (window-height) 7) 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4643 (t 2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4644 (height (1- (window-height)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4645 (bottom (save-excursion (goto-char (point-max))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4646 (forward-line (- height))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4647 (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4648 (window (get-buffer-window (current-buffer))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4649 ;; The user has to want it.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4650 (when gnus-auto-center-summary
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4651 (when (get-buffer-window gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4652 ;; Only do recentering when the article buffer is displayed,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4653 ;; Set the window start to either `bottom', which is the biggest
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4654 ;; possible valid number, or the second line from the top,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4655 ;; whichever is the least.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4656 (set-window-start
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4657 window (min bottom (save-excursion
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4658 (forward-line (- top)) (point)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4659 ;; Do horizontal recentering while we're at it.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4660 (when (and (get-buffer-window (current-buffer) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4661 (not (eq gnus-auto-center-summary 'vertical)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4662 (let ((selected (selected-window)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4663 (select-window (get-buffer-window (current-buffer) t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4664 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4665 (gnus-horizontal-recenter)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4666 (select-window selected))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4667
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4668 (defun gnus-summary-jump-to-group (newsgroup)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4669 "Move point to NEWSGROUP in group mode buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4670 ;; Keep update point of group mode buffer if visible.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4671 (if (eq (current-buffer) (get-buffer gnus-group-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4672 (save-window-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4673 ;; Take care of tree window mode.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4674 (when (get-buffer-window gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4675 (pop-to-buffer gnus-group-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4676 (gnus-group-jump-to-group newsgroup))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4677 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4678 ;; Take care of tree window mode.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4679 (if (get-buffer-window gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4680 (pop-to-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4681 (set-buffer gnus-group-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4682 (gnus-group-jump-to-group newsgroup))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4683
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4684 ;; This function returns a list of article numbers based on the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4685 ;; difference between the ranges of read articles in this group and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4686 ;; the range of active articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4687 (defun gnus-list-of-unread-articles (group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4688 (let* ((read (gnus-info-read (gnus-get-info group)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4689 (active (or (gnus-active group) (gnus-activate-group group)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4690 (last (cdr active))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4691 first nlast unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4692 ;; If none are read, then all are unread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4693 (if (not read)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4694 (setq first (car active))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4695 ;; If the range of read articles is a single range, then the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4696 ;; first unread article is the article after the last read
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4697 ;; article. Sounds logical, doesn't it?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4698 (if (not (listp (cdr read)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4699 (setq first (1+ (cdr read)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4700 ;; `read' is a list of ranges.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4701 (when (/= (setq nlast (or (and (numberp (car read)) (car read))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4702 (caar read)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4703 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4704 (setq first 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4705 (while read
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4706 (when first
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4707 (while (< first nlast)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4708 (push first unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4709 (setq first (1+ first))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4710 (setq first (1+ (if (atom (car read)) (car read) (cdar read))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4711 (setq nlast (if (atom (cadr read)) (cadr read) (caadr read)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4712 (setq read (cdr read)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4713 ;; And add the last unread articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4714 (while (<= first last)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4715 (push first unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4716 (setq first (1+ first)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4717 ;; Return the list of unread articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4718 (nreverse unread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4719
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4720 (defun gnus-list-of-read-articles (group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4721 "Return a list of unread, unticked and non-dormant articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4722 (let* ((info (gnus-get-info group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4723 (marked (gnus-info-marks info))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4724 (active (gnus-active group)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4725 (and info active
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4726 (gnus-set-difference
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4727 (gnus-sorted-complement
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4728 (gnus-uncompress-range active)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4729 (gnus-list-of-unread-articles group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4730 (append
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4731 (gnus-uncompress-range (cdr (assq 'dormant marked)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4732 (gnus-uncompress-range (cdr (assq 'tick marked))))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4733
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4734 ;; Various summary commands
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4735
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4736 (defun gnus-summary-universal-argument (arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4737 "Perform any operation on all articles that are process/prefixed."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4738 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4739 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4740 (let ((articles (gnus-summary-work-articles arg))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4741 func article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4742 (if (eq
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4743 (setq
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4744 func
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4745 (key-binding
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4746 (read-key-sequence
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4747 (substitute-command-keys
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4748 "\\<gnus-summary-mode-map>\\[gnus-summary-universal-argument]"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4749 ))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4750 'undefined)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4751 (gnus-error 1 "Undefined key")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4752 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4753 (while articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4754 (gnus-summary-goto-subject (setq article (pop articles)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4755 (let (gnus-newsgroup-processable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4756 (command-execute func))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4757 (gnus-summary-remove-process-mark article)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4758 (gnus-summary-position-point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4759
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4760 (defun gnus-summary-toggle-truncation (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4761 "Toggle truncation of summary lines.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4762 With arg, turn line truncation on iff arg is positive."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4763 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4764 (setq truncate-lines
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4765 (if (null arg) (not truncate-lines)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4766 (> (prefix-numeric-value arg) 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4767 (redraw-display))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4768
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4769 (defun gnus-summary-reselect-current-group (&optional all rescan)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4770 "Exit and then reselect the current newsgroup.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4771 The prefix argument ALL means to select all articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4772 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4773 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4774 (when (gnus-ephemeral-group-p gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4775 (error "Ephemeral groups can't be reselected"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4776 (let ((current-subject (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4777 (group gnus-newsgroup-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4778 (setq gnus-newsgroup-begin nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4779 (gnus-summary-exit)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
4780 ;; We have to adjust the point of group mode buffer because
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4781 ;; point was moved to the next unread newsgroup by exiting.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4782 (gnus-summary-jump-to-group group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4783 (when rescan
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4784 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4785 (gnus-group-get-new-news-this-group 1)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4786 (gnus-group-read-group all t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4787 (gnus-summary-goto-subject current-subject nil t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4788
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4789 (defun gnus-summary-rescan-group (&optional all)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4790 "Exit the newsgroup, ask for new articles, and select the newsgroup."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4791 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4792 (gnus-summary-reselect-current-group all t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4793
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4794 (defun gnus-summary-update-info (&optional non-destructive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4795 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4796 (let ((group gnus-newsgroup-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4797 (when gnus-newsgroup-kill-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4798 (setq gnus-newsgroup-killed
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4799 (gnus-compress-sequence
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4800 (nconc
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4801 (gnus-set-sorted-intersection
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4802 (gnus-uncompress-range gnus-newsgroup-killed)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4803 (setq gnus-newsgroup-unselected
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4804 (sort gnus-newsgroup-unselected '<)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4805 (setq gnus-newsgroup-unreads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4806 (sort gnus-newsgroup-unreads '<)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4807 t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4808 (unless (listp (cdr gnus-newsgroup-killed))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4809 (setq gnus-newsgroup-killed (list gnus-newsgroup-killed)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4810 (let ((headers gnus-newsgroup-headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4811 (when (and (not gnus-save-score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4812 (not non-destructive))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4813 (setq gnus-newsgroup-scored nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4814 ;; Set the new ranges of read articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4815 (gnus-update-read-articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4816 group (append gnus-newsgroup-unreads gnus-newsgroup-unselected))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4817 ;; Set the current article marks.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4818 (gnus-update-marks)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4819 ;; Do the cross-ref thing.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4820 (when gnus-use-cross-reference
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4821 (gnus-mark-xrefs-as-read group headers gnus-newsgroup-unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4822 ;; Do adaptive scoring, and possibly save score files.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4823 (when gnus-newsgroup-adaptive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4824 (gnus-score-adaptive))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4825 (when gnus-use-scoring
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4826 (gnus-score-save))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4827 ;; Do not switch windows but change the buffer to work.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4828 (set-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4829 (unless (gnus-ephemeral-group-p gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4830 (gnus-group-update-group group))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4831
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4832 (defun gnus-summary-save-newsrc (&optional force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4833 "Save the current number of read/marked articles in the dribble buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4834 The dribble buffer will then be saved.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4835 If FORCE (the prefix), also save the .newsrc file(s)."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4836 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4837 (gnus-summary-update-info t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4838 (if force
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4839 (gnus-save-newsrc-file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4840 (gnus-dribble-save)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4841
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4842 (defun gnus-summary-exit (&optional temporary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4843 "Exit reading current newsgroup, and then return to group selection mode.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4844 gnus-exit-group-hook is called with no arguments if that value is non-nil."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4845 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4846 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4847 (gnus-kill-save-kill-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4848 (let* ((group gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4849 (quit-config (gnus-group-quit-config gnus-newsgroup-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4850 (mode major-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4851 (buf (current-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4852 (run-hooks 'gnus-summary-prepare-exit-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4853 ;; If we have several article buffers, we kill them at exit.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4854 (unless gnus-single-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4855 (gnus-kill-buffer gnus-original-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4856 (setq gnus-article-current nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4857 (when gnus-use-cache
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4858 (gnus-cache-possibly-remove-articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4859 (gnus-cache-save-buffers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4860 (gnus-async-prefetch-remove-group group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4861 (when gnus-suppress-duplicates
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4862 (gnus-dup-enter-articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4863 (when gnus-use-trees
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4864 (gnus-tree-close group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4865 ;; Make all changes in this group permanent.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4866 (unless quit-config
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4867 (run-hooks 'gnus-exit-group-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4868 (gnus-summary-update-info))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4869 (gnus-close-group group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4870 ;; Make sure where I was, and go to next newsgroup.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4871 (set-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4872 (unless quit-config
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4873 (gnus-group-jump-to-group group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4874 (run-hooks 'gnus-summary-exit-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4875 (unless quit-config
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4876 (gnus-group-next-unread-group 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4877 (if temporary
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4878 nil ;Nothing to do.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4879 ;; If we have several article buffers, we kill them at exit.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4880 (unless gnus-single-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4881 (gnus-kill-buffer gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4882 (gnus-kill-buffer gnus-original-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4883 (setq gnus-article-current nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4884 (set-buffer buf)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4885 (if (not gnus-kill-summary-on-exit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4886 (gnus-deaden-summary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4887 ;; We set all buffer-local variables to nil. It is unclear why
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4888 ;; this is needed, but if we don't, buffer-local variables are
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4889 ;; not garbage-collected, it seems. This would the lead to en
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4890 ;; ever-growing Emacs.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4891 (gnus-summary-clear-local-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4892 (when (get-buffer gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4893 (bury-buffer gnus-article-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4894 ;; We clear the global counterparts of the buffer-local
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4895 ;; variables as well, just to be on the safe side.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4896 (set-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4897 (gnus-summary-clear-local-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4898 ;; Return to group mode buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4899 (when (eq mode 'gnus-summary-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4900 (gnus-kill-buffer buf)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4901 (setq gnus-current-select-method gnus-select-method)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4902 (pop-to-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4903 ;; Clear the current group name.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4904 (if (not quit-config)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4905 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4906 (gnus-group-jump-to-group group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4907 (gnus-group-next-unread-group 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4908 (gnus-configure-windows 'group 'force))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4909 (gnus-handle-ephemeral-exit quit-config))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4910 (unless quit-config
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4911 (setq gnus-newsgroup-name nil)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4912
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4913 (defalias 'gnus-summary-quit 'gnus-summary-exit-no-update)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4914 (defun gnus-summary-exit-no-update (&optional no-questions)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4915 "Quit reading current newsgroup without updating read article info."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4916 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4917 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4918 (let* ((group gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4919 (quit-config (gnus-group-quit-config group)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4920 (when (or no-questions
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4921 gnus-expert-user
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4922 (gnus-y-or-n-p "Discard changes to this group and exit? "))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4923 ;; If we have several article buffers, we kill them at exit.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4924 (unless gnus-single-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4925 (gnus-kill-buffer gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4926 (gnus-kill-buffer gnus-original-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4927 (setq gnus-article-current nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4928 (if (not gnus-kill-summary-on-exit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4929 (gnus-deaden-summary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4930 (gnus-close-group group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4931 (gnus-summary-clear-local-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4932 (set-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4933 (gnus-summary-clear-local-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4934 (when (get-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4935 (kill-buffer gnus-summary-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4936 (unless gnus-single-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4937 (setq gnus-article-current nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4938 (when gnus-use-trees
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4939 (gnus-tree-close group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4940 (gnus-async-prefetch-remove-group group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4941 (when (get-buffer gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4942 (bury-buffer gnus-article-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4943 ;; Return to the group buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4944 (gnus-configure-windows 'group 'force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4945 ;; Clear the current group name.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4946 (setq gnus-newsgroup-name nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4947 (when (equal (gnus-group-group-name) group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4948 (gnus-group-next-unread-group 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4949 (when quit-config
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4950 (gnus-handle-ephemeral-exit quit-config)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4951
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4952 (defun gnus-handle-ephemeral-exit (quit-config)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4953 "Handle movement when leaving an ephemeral group. The state
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4954 which existed when entering the ephemeral is reset."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4955 (if (not (buffer-name (car quit-config)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4956 (gnus-configure-windows 'group 'force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4957 (set-buffer (car quit-config))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4958 (cond ((eq major-mode 'gnus-summary-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4959 (gnus-set-global-variables))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4960 ((eq major-mode 'gnus-article-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4961 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4962 ;; The `gnus-summary-buffer' variable may point
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4963 ;; to the old summary buffer when using a single
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4964 ;; article buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4965 (unless (gnus-buffer-live-p gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4966 (set-buffer gnus-group-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4967 (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4968 (gnus-set-global-variables))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4969 (if (or (eq (cdr quit-config) 'article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4970 (eq (cdr quit-config) 'pick))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4971 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4972 ;; The current article may be from the ephemeral group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4973 ;; thus it is best that we reload this article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4974 (gnus-summary-show-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4975 (if (and (boundp 'gnus-pick-mode) (symbol-value 'gnus-pick-mode))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4976 (gnus-configure-windows 'pick 'force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4977 (gnus-configure-windows (cdr quit-config) 'force)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4978 (gnus-configure-windows (cdr quit-config) 'force))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4979 (when (eq major-mode 'gnus-summary-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4980 (gnus-summary-next-subject 1 nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4981 (gnus-summary-recenter)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4982 (gnus-summary-position-point))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4983
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4984 ;;; Dead summaries.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4985
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4986 (defvar gnus-dead-summary-mode-map nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4987
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4988 (unless gnus-dead-summary-mode-map
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4989 (setq gnus-dead-summary-mode-map (make-keymap))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4990 (suppress-keymap gnus-dead-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4991 (substitute-key-definition
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4992 'undefined 'gnus-summary-wake-up-the-dead gnus-dead-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4993 (let ((keys '("\C-d" "\r" "\177")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4994 (while keys
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4995 (define-key gnus-dead-summary-mode-map
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4996 (pop keys) 'gnus-summary-wake-up-the-dead))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4997
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4998 (defvar gnus-dead-summary-mode nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
4999 "Minor mode for Gnus summary buffers.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5000
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5001 (defun gnus-dead-summary-mode (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5002 "Minor mode for Gnus summary buffers."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5003 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5004 (when (eq major-mode 'gnus-summary-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5005 (make-local-variable 'gnus-dead-summary-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5006 (setq gnus-dead-summary-mode
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5007 (if (null arg) (not gnus-dead-summary-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5008 (> (prefix-numeric-value arg) 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5009 (when gnus-dead-summary-mode
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5010 (unless (assq 'gnus-dead-summary-mode minor-mode-alist)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5011 (push '(gnus-dead-summary-mode " Dead") minor-mode-alist))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5012 (unless (assq 'gnus-dead-summary-mode minor-mode-map-alist)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5013 (push (cons 'gnus-dead-summary-mode gnus-dead-summary-mode-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5014 minor-mode-map-alist)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5015
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5016 (defun gnus-deaden-summary ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5017 "Make the current summary buffer into a dead summary buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5018 ;; Kill any previous dead summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5019 (when (and gnus-dead-summary
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5020 (buffer-name gnus-dead-summary))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5021 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5022 (set-buffer gnus-dead-summary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5023 (when gnus-dead-summary-mode
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5024 (kill-buffer (current-buffer)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5025 ;; Make this the current dead summary.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5026 (setq gnus-dead-summary (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5027 (gnus-dead-summary-mode 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5028 (let ((name (buffer-name)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5029 (when (string-match "Summary" name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5030 (rename-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5031 (concat (substring name 0 (match-beginning 0)) "Dead "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5032 (substring name (match-beginning 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5033 t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5034
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5035 (defun gnus-kill-or-deaden-summary (buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5036 "Kill or deaden the summary BUFFER."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5037 (when (and (buffer-name buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5038 (not gnus-single-article-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5039 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5040 (set-buffer buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5041 (gnus-kill-buffer gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5042 (gnus-kill-buffer gnus-original-article-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5043 (cond (gnus-kill-summary-on-exit
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5044 (when (and gnus-use-trees
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5045 (and (get-buffer buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5046 (buffer-name (get-buffer buffer))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5047 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5048 (set-buffer (get-buffer buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5049 (gnus-tree-close gnus-newsgroup-name)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5050 (gnus-kill-buffer buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5051 ((and (get-buffer buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5052 (buffer-name (get-buffer buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5053 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5054 (set-buffer buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5055 (gnus-deaden-summary)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5056
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5057 (defun gnus-summary-wake-up-the-dead (&rest args)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5058 "Wake up the dead summary buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5059 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5060 (gnus-dead-summary-mode -1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5061 (let ((name (buffer-name)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5062 (when (string-match "Dead " name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5063 (rename-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5064 (concat (substring name 0 (match-beginning 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5065 (substring name (match-end 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5066 t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5067 (gnus-message 3 "This dead summary is now alive again"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5068
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5069 ;; Suggested by Andrew Eskilsson <pi92ae@pt.hk-r.se>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5070 (defun gnus-summary-fetch-faq (&optional faq-dir)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5071 "Fetch the FAQ for the current group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5072 If FAQ-DIR (the prefix), prompt for a directory to search for the faq
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5073 in."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5074 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5075 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5076 (when current-prefix-arg
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5077 (completing-read
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5078 "Faq dir: " (and (listp gnus-group-faq-directory)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5079 gnus-group-faq-directory)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5080 (let (gnus-faq-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5081 (when (setq gnus-faq-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5082 (gnus-group-fetch-faq gnus-newsgroup-name faq-dir))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5083 (gnus-configure-windows 'summary-faq))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5084
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5085 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5086 (defun gnus-summary-describe-group (&optional force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5087 "Describe the current newsgroup."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5088 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5089 (gnus-group-describe-group force gnus-newsgroup-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5090
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5091 (defun gnus-summary-describe-briefly ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5092 "Describe summary mode commands briefly."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5093 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5094 (gnus-message 6
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5095 (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")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5096
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5097 ;; Walking around group mode buffer from summary mode.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5098
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5099 (defun gnus-summary-next-group (&optional no-article target-group backward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5100 "Exit current newsgroup and then select next unread newsgroup.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5101 If prefix argument NO-ARTICLE is non-nil, no article is selected
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5102 initially. If NEXT-GROUP, go to this group. If BACKWARD, go to
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5103 previous group instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5104 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5105 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5106 ;; Stop pre-fetching.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5107 (gnus-async-halt-prefetch)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5108 (let ((current-group gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5109 (current-buffer (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5110 entered)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5111 ;; First we semi-exit this group to update Xrefs and all variables.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5112 ;; We can't do a real exit, because the window conf must remain
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5113 ;; the same in case the user is prompted for info, and we don't
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5114 ;; want the window conf to change before that...
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5115 (gnus-summary-exit t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5116 (while (not entered)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5117 ;; Then we find what group we are supposed to enter.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5118 (set-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5119 (gnus-group-jump-to-group current-group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5120 (setq target-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5121 (or target-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5122 (if (eq gnus-keep-same-level 'best)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5123 (gnus-summary-best-group gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5124 (gnus-summary-search-group backward gnus-keep-same-level))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5125 (if (not target-group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5126 ;; There are no further groups, so we return to the group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5127 ;; buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5128 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5129 (gnus-message 5 "Returning to the group buffer")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5130 (setq entered t)
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
5131 (when (buffer-live-p current-buffer)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
5132 (set-buffer current-buffer)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
5133 (gnus-summary-exit))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5134 (run-hooks 'gnus-group-no-more-groups-hook))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5135 ;; We try to enter the target group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5136 (gnus-group-jump-to-group target-group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5137 (let ((unreads (gnus-group-group-unread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5138 (if (and (or (eq t unreads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5139 (and unreads (not (zerop unreads))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5140 (gnus-summary-read-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5141 target-group nil no-article current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5142 (setq entered t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5143 (setq current-group target-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5144 target-group nil)))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5145
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5146 (defun gnus-summary-prev-group (&optional no-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5147 "Exit current newsgroup and then select previous unread newsgroup.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5148 If prefix argument NO-ARTICLE is non-nil, no article is selected initially."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5149 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5150 (gnus-summary-next-group no-article nil t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5151
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5152 ;; Walking around summary lines.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5153
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5154 (defun gnus-summary-first-subject (&optional unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5155 "Go to the first unread subject.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5156 If UNREAD is non-nil, go to the first unread article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5157 Returns the article selected or nil if there are no unread articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5158 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5159 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5160 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5161 ;; Empty summary.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5162 ((null gnus-newsgroup-data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5163 (gnus-message 3 "No articles in the group")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5164 nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5165 ;; Pick the first article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5166 ((not unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5167 (goto-char (gnus-data-pos (car gnus-newsgroup-data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5168 (gnus-data-number (car gnus-newsgroup-data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5169 ;; No unread articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5170 ((null gnus-newsgroup-unreads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5171 (gnus-message 3 "No more unread articles")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5172 nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5173 ;; Find the first unread article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5174 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5175 (let ((data gnus-newsgroup-data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5176 (while (and data
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5177 (not (gnus-data-unread-p (car data))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5178 (setq data (cdr data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5179 (when data
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5180 (goto-char (gnus-data-pos (car data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5181 (gnus-data-number (car data))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5182 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5183
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5184 (defun gnus-summary-next-subject (n &optional unread dont-display)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5185 "Go to next N'th summary line.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5186 If N is negative, go to the previous N'th subject line.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5187 If UNREAD is non-nil, only unread articles are selected.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5188 The difference between N and the actual number of steps taken is
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5189 returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5190 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5191 (let ((backward (< n 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5192 (n (abs n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5193 (while (and (> n 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5194 (if backward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5195 (gnus-summary-find-prev unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5196 (gnus-summary-find-next unread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5197 (setq n (1- n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5198 (when (/= 0 n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5199 (gnus-message 7 "No more%s articles"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5200 (if unread " unread" "")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5201 (unless dont-display
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5202 (gnus-summary-recenter)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5203 (gnus-summary-position-point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5204 n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5205
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5206 (defun gnus-summary-next-unread-subject (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5207 "Go to next N'th unread summary line."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5208 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5209 (gnus-summary-next-subject n t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5210
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5211 (defun gnus-summary-prev-subject (n &optional unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5212 "Go to previous N'th summary line.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5213 If optional argument UNREAD is non-nil, only unread article is selected."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5214 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5215 (gnus-summary-next-subject (- n) unread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5216
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5217 (defun gnus-summary-prev-unread-subject (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5218 "Go to previous N'th unread summary line."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5219 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5220 (gnus-summary-next-subject (- n) t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5221
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5222 (defun gnus-summary-goto-subject (article &optional force silent)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5223 "Go the subject line of ARTICLE.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5224 If FORCE, also allow jumping to articles not currently shown."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5225 (interactive "nArticle number: ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5226 (let ((b (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5227 (data (gnus-data-find article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5228 ;; We read in the article if we have to.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5229 (and (not data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5230 force
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5231 (gnus-summary-insert-subject article (and (vectorp force) force) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5232 (setq data (gnus-data-find article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5233 (goto-char b)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5234 (if (not data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5235 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5236 (unless silent
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5237 (gnus-message 3 "Can't find article %d" article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5238 nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5239 (goto-char (gnus-data-pos data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5240 article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5241
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5242 ;; Walking around summary lines with displaying articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5243
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5244 (defun gnus-summary-expand-window (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5245 "Make the summary buffer take up the entire Emacs frame.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5246 Given a prefix, will force an `article' buffer configuration."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5247 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5248 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5249 (if arg
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5250 (gnus-configure-windows 'article 'force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5251 (gnus-configure-windows 'summary 'force)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5252
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5253 (defun gnus-summary-display-article (article &optional all-header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5254 "Display ARTICLE in article buffer."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5255 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5256 (if (null article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5257 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5258 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5259 (if gnus-summary-display-article-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5260 (funcall gnus-summary-display-article-function article all-header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5261 (gnus-article-prepare article all-header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5262 (run-hooks 'gnus-select-article-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5263 (when (and gnus-current-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5264 (not (zerop gnus-current-article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5265 (gnus-summary-goto-subject gnus-current-article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5266 (gnus-summary-recenter)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5267 (when (and gnus-use-trees gnus-show-threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5268 (gnus-possibly-generate-tree article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5269 (gnus-highlight-selected-tree article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5270 ;; Successfully display article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5271 (gnus-article-set-window-start
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5272 (cdr (assq article gnus-newsgroup-bookmarks))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5273
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5274 (defun gnus-summary-select-article (&optional all-headers force pseudo article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5275 "Select the current article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5276 If ALL-HEADERS is non-nil, show all header fields. If FORCE is
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5277 non-nil, the article will be re-fetched even if it already present in
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5278 the article buffer. If PSEUDO is non-nil, pseudo-articles will also
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5279 be displayed."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5280 ;; Make sure we are in the summary buffer to work around bbdb bug.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5281 (unless (eq major-mode 'gnus-summary-mode)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5282 (set-buffer gnus-summary-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5283 (let ((article (or article (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5284 (all-headers (not (not all-headers))) ;Must be T or NIL.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5285 gnus-summary-display-article-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5286 did)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5287 (and (not pseudo)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5288 (gnus-summary-article-pseudo-p article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5289 (error "This is a pseudo-article."))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5290 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5291 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5292 (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5293 (if (or (and gnus-single-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5294 (or (null gnus-current-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5295 (null gnus-article-current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5296 (null (get-buffer gnus-article-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5297 (not (eq article (cdr gnus-article-current)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5298 (not (equal (car gnus-article-current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5299 gnus-newsgroup-name))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5300 (and (not gnus-single-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5301 (or (null gnus-current-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5302 (not (eq gnus-current-article article))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5303 force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5304 ;; The requested article is different from the current article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5305 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5306 (gnus-summary-display-article article all-headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5307 (setq did article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5308 (when (or all-headers gnus-show-all-headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5309 (gnus-article-show-all-headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5310 'old))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5311 (when did
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5312 (gnus-article-set-window-start
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5313 (cdr (assq article gnus-newsgroup-bookmarks)))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5314
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5315 (defun gnus-summary-set-current-mark (&optional current-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5316 "Obsolete function."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5317 nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5318
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5319 (defun gnus-summary-next-article (&optional unread subject backward push)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5320 "Select the next article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5321 If UNREAD, only unread articles are selected.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5322 If SUBJECT, only articles with SUBJECT are selected.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5323 If BACKWARD, the previous article is selected instead of the next."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5324 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5325 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5326 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5327 ;; Is there such an article?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5328 ((and (gnus-summary-search-forward unread subject backward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5329 (or (gnus-summary-display-article (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5330 (eq (gnus-summary-article-mark) gnus-canceled-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5331 (gnus-summary-position-point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5332 ;; If not, we try the first unread, if that is wanted.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5333 ((and subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5334 gnus-auto-select-same
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5335 (gnus-summary-first-unread-article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5336 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5337 (gnus-message 6 "Wrapped"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5338 ;; Try to get next/previous article not displayed in this group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5339 ((and gnus-auto-extend-newsgroup
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5340 (not unread) (not subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5341 (gnus-summary-goto-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5342 (if backward (1- gnus-newsgroup-begin) (1+ gnus-newsgroup-end))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5343 nil t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5344 ;; Go to next/previous group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5345 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5346 (unless (gnus-ephemeral-group-p gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5347 (gnus-summary-jump-to-group gnus-newsgroup-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5348 (let ((cmd last-command-char)
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
5349 (point
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
5350 (save-excursion
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
5351 (set-buffer gnus-group-buffer)
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
5352 (point)))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5353 (group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5354 (if (eq gnus-keep-same-level 'best)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5355 (gnus-summary-best-group gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5356 (gnus-summary-search-group backward gnus-keep-same-level))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5357 ;; For some reason, the group window gets selected. We change
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5358 ;; it back.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5359 (select-window (get-buffer-window (current-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5360 ;; Select next unread newsgroup automagically.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5361 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5362 ((or (not gnus-auto-select-next)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5363 (not cmd))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5364 (gnus-message 7 "No more%s articles" (if unread " unread" "")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5365 ((or (eq gnus-auto-select-next 'quietly)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5366 (and (eq gnus-auto-select-next 'slightly-quietly)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5367 push)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5368 (and (eq gnus-auto-select-next 'almost-quietly)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5369 (gnus-summary-last-article-p)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5370 ;; Select quietly.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5371 (if (gnus-ephemeral-group-p gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5372 (gnus-summary-exit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5373 (gnus-message 7 "No more%s articles (%s)..."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5374 (if unread " unread" "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5375 (if group (concat "selecting " group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5376 "exiting"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5377 (gnus-summary-next-group nil group backward)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5378 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5379 (when (gnus-key-press-event-p last-input-event)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5380 (gnus-summary-walk-group-buffer
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
5381 gnus-newsgroup-name cmd unread backward point))))))))
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
5382
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
5383 (defun gnus-summary-walk-group-buffer (from-group cmd unread backward start)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5384 (let ((keystrokes '((?\C-n (gnus-group-next-unread-group 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5385 (?\C-p (gnus-group-prev-unread-group 1))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5386 (cursor-in-echo-area t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5387 keve key group ended)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5388 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5389 (set-buffer gnus-group-buffer)
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
5390 (goto-char start)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5391 (setq group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5392 (if (eq gnus-keep-same-level 'best)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5393 (gnus-summary-best-group gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5394 (gnus-summary-search-group backward gnus-keep-same-level))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5395 (while (not ended)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5396 (gnus-message
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5397 5 "No more%s articles%s" (if unread " unread" "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5398 (if (and group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5399 (not (gnus-ephemeral-group-p gnus-newsgroup-name)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5400 (format " (Type %s for %s [%s])"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5401 (single-key-description cmd) group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5402 (car (gnus-gethash group gnus-newsrc-hashtb)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5403 (format " (Type %s to exit %s)"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5404 (single-key-description cmd)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5405 gnus-newsgroup-name)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5406 ;; Confirm auto selection.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5407 (setq key (car (setq keve (gnus-read-event-char))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5408 (setq ended t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5409 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5410 ((assq key keystrokes)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5411 (let ((obuf (current-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5412 (switch-to-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5413 (when group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5414 (gnus-group-jump-to-group group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5415 (eval (cadr (assq key keystrokes)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5416 (setq group (gnus-group-group-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5417 (switch-to-buffer obuf))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5418 (setq ended nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5419 ((equal key cmd)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5420 (if (or (not group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5421 (gnus-ephemeral-group-p gnus-newsgroup-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5422 (gnus-summary-exit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5423 (gnus-summary-next-group nil group backward)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5424 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5425 (push (cdr keve) unread-command-events))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5426
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5427 (defun gnus-summary-next-unread-article ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5428 "Select unread article after current one."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5429 (interactive)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
5430 (gnus-summary-next-article
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5431 (or (not (eq gnus-summary-goto-unread 'never))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5432 (gnus-summary-last-article-p (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5433 (and gnus-auto-select-same
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5434 (gnus-summary-article-subject))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5435
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5436 (defun gnus-summary-prev-article (&optional unread subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5437 "Select the article after the current one.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5438 If UNREAD is non-nil, only unread articles are selected."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5439 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5440 (gnus-summary-next-article unread subject t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5441
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5442 (defun gnus-summary-prev-unread-article ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5443 "Select unread article before current one."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5444 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5445 (gnus-summary-prev-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5446 (or (not (eq gnus-summary-goto-unread 'never))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5447 (gnus-summary-first-article-p (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5448 (and gnus-auto-select-same
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5449 (gnus-summary-article-subject))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5450
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5451 (defun gnus-summary-next-page (&optional lines circular)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5452 "Show next page of the selected article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5453 If at the end of the current article, select the next article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5454 LINES says how many lines should be scrolled up.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5455
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5456 If CIRCULAR is non-nil, go to the start of the article instead of
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5457 selecting the next article when reaching the end of the current
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5458 article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5459 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5460 (setq gnus-summary-buffer (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5461 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5462 (let ((article (gnus-summary-article-number))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
5463 (article-window (get-buffer-window gnus-article-buffer t))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5464 endp)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5465 (gnus-configure-windows 'article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5466 (if (eq (cdr (assq article gnus-newsgroup-reads)) gnus-canceled-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5467 (if (and (eq gnus-summary-goto-unread 'never)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5468 (not (gnus-summary-last-article-p article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5469 (gnus-summary-next-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5470 (gnus-summary-next-unread-article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5471 (if (or (null gnus-current-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5472 (null gnus-article-current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5473 (/= article (cdr gnus-article-current))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5474 (not (equal (car gnus-article-current) gnus-newsgroup-name)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5475 ;; Selected subject is different from current article's.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5476 (gnus-summary-display-article article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5477 (when article-window
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5478 (gnus-eval-in-buffer-window gnus-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5479 (setq endp (gnus-article-next-page lines)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5480 (when endp
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5481 (cond (circular
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5482 (gnus-summary-beginning-of-article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5483 (lines
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5484 (gnus-message 3 "End of message"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5485 ((null lines)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5486 (if (and (eq gnus-summary-goto-unread 'never)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5487 (not (gnus-summary-last-article-p article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5488 (gnus-summary-next-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5489 (gnus-summary-next-unread-article))))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5490 (gnus-summary-recenter)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5491 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5492
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5493 (defun gnus-summary-prev-page (&optional lines move)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5494 "Show previous page of selected article.
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5495 Argument LINES specifies lines to be scrolled down.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5496 If MOVE, move to the previous unread article if point is at
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5497 the beginning of the buffer."
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5498 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5499 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5500 (let ((article (gnus-summary-article-number))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5501 (article-window (get-buffer-window gnus-article-buffer t))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5502 endp)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5503 (gnus-configure-windows 'article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5504 (if (or (null gnus-current-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5505 (null gnus-article-current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5506 (/= article (cdr gnus-article-current))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5507 (not (equal (car gnus-article-current) gnus-newsgroup-name)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5508 ;; Selected subject is different from current article's.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5509 (gnus-summary-display-article article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5510 (gnus-summary-recenter)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5511 (when article-window
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5512 (gnus-eval-in-buffer-window gnus-article-buffer
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5513 (setq endp (gnus-article-prev-page lines)))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5514 (when (and move endp)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5515 (cond (lines
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5516 (gnus-message 3 "Beginning of message"))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5517 ((null lines)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5518 (if (and (eq gnus-summary-goto-unread 'never)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5519 (not (gnus-summary-first-article-p article)))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5520 (gnus-summary-prev-article)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5521 (gnus-summary-prev-unread-article))))))))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5522 (gnus-summary-position-point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5523
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5524 (defun gnus-summary-prev-page-or-article (&optional lines)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5525 "Show previous page of selected article.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5526 Argument LINES specifies lines to be scrolled down.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5527 If at the beginning of the article, go to the next article."
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5528 (interactive "P")
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5529 (gnus-summary-prev-page lines t))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5530
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5531 (defun gnus-summary-scroll-up (lines)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5532 "Scroll up (or down) one line current article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5533 Argument LINES specifies lines to be scrolled up (or down if negative)."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5534 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5535 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5536 (gnus-configure-windows 'article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5537 (gnus-summary-show-thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5538 (when (eq (gnus-summary-select-article nil nil 'pseudo) 'old)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5539 (gnus-eval-in-buffer-window gnus-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5540 (cond ((> lines 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5541 (when (gnus-article-next-page lines)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5542 (gnus-message 3 "End of message")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5543 ((< lines 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5544 (gnus-article-prev-page (- lines))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5545 (gnus-summary-recenter)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5546 (gnus-summary-position-point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5547
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5548 (defun gnus-summary-next-same-subject ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5549 "Select next article which has the same subject as current one."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5550 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5551 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5552 (gnus-summary-next-article nil (gnus-summary-article-subject)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5553
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5554 (defun gnus-summary-prev-same-subject ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5555 "Select previous article which has the same subject as current one."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5556 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5557 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5558 (gnus-summary-prev-article nil (gnus-summary-article-subject)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5559
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5560 (defun gnus-summary-next-unread-same-subject ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5561 "Select next unread article which has the same subject as current one."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5562 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5563 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5564 (gnus-summary-next-article t (gnus-summary-article-subject)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5565
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5566 (defun gnus-summary-prev-unread-same-subject ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5567 "Select previous unread article which has the same subject as current one."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5568 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5569 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5570 (gnus-summary-prev-article t (gnus-summary-article-subject)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5571
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5572 (defun gnus-summary-first-unread-article ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5573 "Select the first unread article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5574 Return nil if there are no unread articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5575 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5576 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5577 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5578 (when (gnus-summary-first-subject t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5579 (gnus-summary-show-thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5580 (gnus-summary-first-subject t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5581 (gnus-summary-display-article (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5582 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5583
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5584 (defun gnus-summary-first-article ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5585 "Select the first article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5586 Return nil if there are no articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5587 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5588 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5589 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5590 (when (gnus-summary-first-subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5591 (gnus-summary-show-thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5592 (gnus-summary-first-subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5593 (gnus-summary-display-article (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5594 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5595
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5596 (defun gnus-summary-best-unread-article ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5597 "Select the unread article with the highest score."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5598 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5599 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5600 (let ((best -1000000)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5601 (data gnus-newsgroup-data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5602 article score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5603 (while data
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5604 (and (gnus-data-unread-p (car data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5605 (> (setq score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5606 (gnus-summary-article-score (gnus-data-number (car data))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5607 best)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5608 (setq best score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5609 article (gnus-data-number (car data))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5610 (setq data (cdr data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5611 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5612 (if article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5613 (gnus-summary-goto-article article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5614 (error "No unread articles"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5615 (gnus-summary-position-point))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5616
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5617 (defun gnus-summary-last-subject ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5618 "Go to the last displayed subject line in the group."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5619 (let ((article (gnus-data-number (car (gnus-data-list t)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5620 (when article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5621 (gnus-summary-goto-subject article))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5622
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5623 (defun gnus-summary-goto-article (article &optional all-headers force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5624 "Fetch ARTICLE and display it if it exists.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5625 If ALL-HEADERS is non-nil, no header lines are hidden."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5626 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5627 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5628 (string-to-int
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5629 (completing-read
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5630 "Article number: "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5631 (mapcar (lambda (number) (list (int-to-string number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5632 gnus-newsgroup-limit)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5633 current-prefix-arg
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5634 t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5635 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5636 (if (gnus-summary-goto-subject article force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5637 (gnus-summary-display-article article all-headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5638 (gnus-message 4 "Couldn't go to article %s" article) nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5639 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5640
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5641 (defun gnus-summary-goto-last-article ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5642 "Go to the previously read article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5643 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5644 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5645 (when gnus-last-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5646 (gnus-summary-goto-article gnus-last-article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5647 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5648
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5649 (defun gnus-summary-pop-article (number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5650 "Pop one article off the history and go to the previous.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5651 NUMBER articles will be popped off."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5652 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5653 (let (to)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5654 (setq gnus-newsgroup-history
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5655 (cdr (setq to (nthcdr number gnus-newsgroup-history))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5656 (if to
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5657 (gnus-summary-goto-article (car to))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5658 (error "Article history empty")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5659 (gnus-summary-position-point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5660
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5661 ;; Summary commands and functions for limiting the summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5662
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5663 (defun gnus-summary-limit-to-articles (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5664 "Limit the summary buffer to the next N articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5665 If not given a prefix, use the process marked articles instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5666 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5667 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5668 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5669 (let ((articles (gnus-summary-work-articles n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5670 (setq gnus-newsgroup-processable nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5671 (gnus-summary-limit articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5672 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5673
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5674 (defun gnus-summary-pop-limit (&optional total)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5675 "Restore the previous limit.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5676 If given a prefix, remove all limits."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5677 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5678 (gnus-set-global-variables)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
5679 (when total
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5680 (setq gnus-newsgroup-limits
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5681 (list (mapcar (lambda (h) (mail-header-number h))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5682 gnus-newsgroup-headers))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5683 (unless gnus-newsgroup-limits
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5684 (error "No limit to pop"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5685 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5686 (gnus-summary-limit nil 'pop)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5687 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5688
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5689 (defun gnus-summary-limit-to-subject (subject &optional header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5690 "Limit the summary buffer to articles that have subjects that match a regexp."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5691 (interactive "sLimit to subject (regexp): ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5692 (unless header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5693 (setq header "subject"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5694 (when (not (equal "" subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5695 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5696 (let ((articles (gnus-summary-find-matching
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5697 (or header "subject") subject 'all)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5698 (unless articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5699 (error "Found no matches for \"%s\"" subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5700 (gnus-summary-limit articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5701 (gnus-summary-position-point))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5702
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5703 (defun gnus-summary-limit-to-author (from)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5704 "Limit the summary buffer to articles that have authors that match a regexp."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5705 (interactive "sLimit to author (regexp): ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5706 (gnus-summary-limit-to-subject from "from"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5707
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5708 (defun gnus-summary-limit-to-age (age &optional younger-p)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
5709 "Limit the summary buffer to articles that are older than (or equal) AGE days.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5710 If YOUNGER-P (the prefix) is non-nil, limit the summary buffer to
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5711 articles that are younger than AGE days."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5712 (interactive "nTime in days: \nP")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5713 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5714 (let ((data gnus-newsgroup-data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5715 (cutoff (nnmail-days-to-time age))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5716 articles d date is-younger)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5717 (while (setq d (pop data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5718 (when (and (vectorp (gnus-data-header d))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5719 (setq date (mail-header-date (gnus-data-header d))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5720 (setq is-younger (nnmail-time-less
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5721 (nnmail-time-since (nnmail-date-to-time date))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5722 cutoff))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5723 (when (if younger-p is-younger (not is-younger))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5724 (push (gnus-data-number d) articles))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5725 (gnus-summary-limit (nreverse articles)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5726 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5727
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5728 (defalias 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5729 (make-obsolete
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5730 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5731
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5732 (defun gnus-summary-limit-to-unread (&optional all)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5733 "Limit the summary buffer to articles that are not marked as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5734 If ALL is non-nil, limit strictly to unread articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5735 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5736 (if all
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5737 (gnus-summary-limit-to-marks (char-to-string gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5738 (gnus-summary-limit-to-marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5739 ;; Concat all the marks that say that an article is read and have
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5740 ;; those removed.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5741 (list gnus-del-mark gnus-read-mark gnus-ancient-mark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5742 gnus-killed-mark gnus-kill-file-mark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5743 gnus-low-score-mark gnus-expirable-mark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5744 gnus-canceled-mark gnus-catchup-mark gnus-sparse-mark
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
5745 gnus-duplicate-mark gnus-souped-mark)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5746 'reverse)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5747
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5748 (defalias 'gnus-summary-delete-marked-with 'gnus-summary-limit-exclude-marks)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5749 (make-obsolete 'gnus-summary-delete-marked-with
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5750 'gnus-summary-limit-exlude-marks)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5751
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5752 (defun gnus-summary-limit-exclude-marks (marks &optional reverse)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5753 "Exclude articles that are marked with MARKS (e.g. \"DK\").
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5754 If REVERSE, limit the summary buffer to articles that are marked
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5755 with MARKS. MARKS can either be a string of marks or a list of marks.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5756 Returns how many articles were removed."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5757 (interactive "sMarks: ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5758 (gnus-summary-limit-to-marks marks t))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
5759
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5760 (defun gnus-summary-limit-to-marks (marks &optional reverse)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5761 "Limit the summary buffer to articles that are marked with MARKS (e.g. \"DK\").
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5762 If REVERSE (the prefix), limit the summary buffer to articles that are
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5763 not marked with MARKS. MARKS can either be a string of marks or a
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5764 list of marks.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5765 Returns how many articles were removed."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5766 (interactive (list (read-string "Marks: ") current-prefix-arg))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5767 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5768 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5769 (let ((data gnus-newsgroup-data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5770 (marks (if (listp marks) marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5771 (append marks nil))) ; Transform to list.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5772 articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5773 (while data
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5774 (when (if reverse (not (memq (gnus-data-mark (car data)) marks))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5775 (memq (gnus-data-mark (car data)) marks))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5776 (push (gnus-data-number (car data)) articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5777 (setq data (cdr data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5778 (gnus-summary-limit articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5779 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5780
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5781 (defun gnus-summary-limit-to-score (&optional score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5782 "Limit to articles with score at or above SCORE."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5783 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5784 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5785 (setq score (if score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5786 (prefix-numeric-value score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5787 (or gnus-summary-default-score 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5788 (let ((data gnus-newsgroup-data)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5789 articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5790 (while data
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5791 (when (>= (gnus-summary-article-score (gnus-data-number (car data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5792 score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5793 (push (gnus-data-number (car data)) articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5794 (setq data (cdr data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5795 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5796 (gnus-summary-limit articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5797 (gnus-summary-position-point))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5798
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5799 (defun gnus-summary-limit-include-dormant ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5800 "Display all the hidden articles that are marked as dormant."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5801 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5802 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5803 (unless gnus-newsgroup-dormant
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5804 (error "There are no dormant articles in this group"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5805 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5806 (gnus-summary-limit (append gnus-newsgroup-dormant gnus-newsgroup-limit))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5807 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5808
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5809 (defun gnus-summary-limit-exclude-dormant ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5810 "Hide all dormant articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5811 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5812 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5813 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5814 (gnus-summary-limit-to-marks (list gnus-dormant-mark) 'reverse)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5815 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5816
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5817 (defun gnus-summary-limit-exclude-childless-dormant ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5818 "Hide all dormant articles that have no children."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5819 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5820 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5821 (let ((data (gnus-data-list t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5822 articles d children)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5823 ;; Find all articles that are either not dormant or have
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5824 ;; children.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5825 (while (setq d (pop data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5826 (when (or (not (= (gnus-data-mark d) gnus-dormant-mark))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
5827 (and (setq children
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5828 (gnus-article-children (gnus-data-number d)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5829 (let (found)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5830 (while children
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5831 (when (memq (car children) articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5832 (setq children nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5833 found t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5834 (pop children))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5835 found)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5836 (push (gnus-data-number d) articles)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5837 ;; Do the limiting.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5838 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5839 (gnus-summary-limit articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5840 (gnus-summary-position-point))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5841
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5842 (defun gnus-summary-limit-mark-excluded-as-read (&optional all)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5843 "Mark all unread excluded articles as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5844 If ALL, mark even excluded ticked and dormants as read."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5845 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5846 (let ((articles (gnus-sorted-complement
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5847 (sort
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5848 (mapcar (lambda (h) (mail-header-number h))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5849 gnus-newsgroup-headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5850 '<)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5851 (sort gnus-newsgroup-limit '<)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5852 article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5853 (setq gnus-newsgroup-unreads nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5854 (if all
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5855 (setq gnus-newsgroup-dormant nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5856 gnus-newsgroup-marked nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5857 gnus-newsgroup-reads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5858 (nconc
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5859 (mapcar (lambda (n) (cons n gnus-catchup-mark)) articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5860 gnus-newsgroup-reads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5861 (while (setq article (pop articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5862 (unless (or (memq article gnus-newsgroup-dormant)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5863 (memq article gnus-newsgroup-marked))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5864 (push (cons article gnus-catchup-mark) gnus-newsgroup-reads))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5865
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5866 (defun gnus-summary-limit (articles &optional pop)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5867 (if pop
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5868 ;; We pop the previous limit off the stack and use that.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5869 (setq articles (car gnus-newsgroup-limits)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5870 gnus-newsgroup-limits (cdr gnus-newsgroup-limits))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5871 ;; We use the new limit, so we push the old limit on the stack.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5872 (push gnus-newsgroup-limit gnus-newsgroup-limits))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5873 ;; Set the limit.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5874 (setq gnus-newsgroup-limit articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5875 (let ((total (length gnus-newsgroup-data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5876 (data (gnus-data-find-list (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5877 (gnus-summary-mark-below nil) ; Inhibit this.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5878 found)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5879 ;; This will do all the work of generating the new summary buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5880 ;; according to the new limit.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5881 (gnus-summary-prepare)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5882 ;; Hide any threads, possibly.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5883 (and gnus-show-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5884 gnus-thread-hide-subtree
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5885 (gnus-summary-hide-all-threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5886 ;; Try to return to the article you were at, or one in the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5887 ;; neighborhood.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5888 (when data
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5889 ;; We try to find some article after the current one.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5890 (while data
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5891 (when (gnus-summary-goto-subject (gnus-data-number (car data)) nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5892 (setq data nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5893 found t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5894 (setq data (cdr data))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5895 (unless found
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5896 ;; If there is no data, that means that we were after the last
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5897 ;; article. The same goes when we can't find any articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5898 ;; after the current one.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5899 (goto-char (point-max))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5900 (gnus-summary-find-prev))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5901 ;; We return how many articles were removed from the summary
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5902 ;; buffer as a result of the new limit.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5903 (- total (length gnus-newsgroup-data))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5904
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5905 (defsubst gnus-invisible-cut-children (threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5906 (let ((num 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5907 (while threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5908 (when (memq (mail-header-number (caar threads)) gnus-newsgroup-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5909 (incf num))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5910 (pop threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5911 (< num 2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5912
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5913 (defsubst gnus-cut-thread (thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5914 "Go forwards in the thread until we find an article that we want to display."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5915 (when (or (eq gnus-fetch-old-headers 'some)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5916 (eq gnus-build-sparse-threads 'some)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5917 (eq gnus-build-sparse-threads 'more))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5918 ;; Deal with old-fetched headers and sparse threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5919 (while (and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5920 thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5921 (or
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5922 (gnus-summary-article-sparse-p (mail-header-number (car thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5923 (gnus-summary-article-ancient-p
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5924 (mail-header-number (car thread))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5925 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5926 (if (<= (length (cdr thread)) 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5927 (setq thread (cadr thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5928 (when (gnus-invisible-cut-children (cdr thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5929 (let ((th (cdr thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5930 (while th
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5931 (if (memq (mail-header-number (caar th))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5932 gnus-newsgroup-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5933 (setq thread (car th)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5934 th nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5935 (setq th (cdr th)))))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5936 ))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5937 thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5938
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5939 (defun gnus-cut-threads (threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5940 "Cut off all uninteresting articles from the beginning of threads."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5941 (when (or (eq gnus-fetch-old-headers 'some)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5942 (eq gnus-build-sparse-threads 'some)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5943 (eq gnus-build-sparse-threads 'more))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5944 (let ((th threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5945 (while th
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5946 (setcar th (gnus-cut-thread (car th)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5947 (setq th (cdr th)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5948 ;; Remove nixed out threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5949 (delq nil threads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5950
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5951 (defun gnus-summary-initial-limit (&optional show-if-empty)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5952 "Figure out what the initial limit is supposed to be on group entry.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5953 This entails weeding out unwanted dormants, low-scored articles,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5954 fetch-old-headers verbiage, and so on."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5955 ;; Most groups have nothing to remove.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5956 (if (or gnus-inhibit-limiting
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5957 (and (null gnus-newsgroup-dormant)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5958 (not (eq gnus-fetch-old-headers 'some))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5959 (null gnus-summary-expunge-below)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5960 (not (eq gnus-build-sparse-threads 'some))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5961 (not (eq gnus-build-sparse-threads 'more))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5962 (null gnus-thread-expunge-below)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5963 (not gnus-use-nocem)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5964 () ; Do nothing.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5965 (push gnus-newsgroup-limit gnus-newsgroup-limits)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5966 (setq gnus-newsgroup-limit nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5967 (mapatoms
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5968 (lambda (node)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5969 (unless (car (symbol-value node))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5970 ;; These threads have no parents -- they are roots.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5971 (let ((nodes (cdr (symbol-value node)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5972 thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5973 (while nodes
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5974 (if (and gnus-thread-expunge-below
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5975 (< (gnus-thread-total-score (car nodes))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5976 gnus-thread-expunge-below))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5977 (gnus-expunge-thread (pop nodes))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5978 (setq thread (pop nodes))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5979 (gnus-summary-limit-children thread))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5980 gnus-newsgroup-dependencies)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5981 ;; If this limitation resulted in an empty group, we might
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5982 ;; pop the previous limit and use it instead.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5983 (when (and (not gnus-newsgroup-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5984 show-if-empty)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5985 (setq gnus-newsgroup-limit (pop gnus-newsgroup-limits)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5986 gnus-newsgroup-limit))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5987
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5988 (defun gnus-summary-limit-children (thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5989 "Return 1 if this subthread is visible and 0 if it is not."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5990 ;; First we get the number of visible children to this thread. This
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5991 ;; is done by recursing down the thread using this function, so this
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5992 ;; will really go down to a leaf article first, before slowly
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5993 ;; working its way up towards the root.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5994 (when thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5995 (let ((children
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5996 (if (cdr thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5997 (apply '+ (mapcar 'gnus-summary-limit-children
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5998 (cdr thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
5999 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6000 (number (mail-header-number (car thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6001 score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6002 (if (and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6003 (not (memq number gnus-newsgroup-marked))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6004 (or
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6005 ;; If this article is dormant and has absolutely no visible
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6006 ;; children, then this article isn't visible.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6007 (and (memq number gnus-newsgroup-dormant)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6008 (zerop children))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6009 ;; If this is "fetch-old-headered" and there is no
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6010 ;; visible children, then we don't want this article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6011 (and (eq gnus-fetch-old-headers 'some)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6012 (gnus-summary-article-ancient-p number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6013 (zerop children))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6014 ;; If this is a sparsely inserted article with no children,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6015 ;; we don't want it.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6016 (and (eq gnus-build-sparse-threads 'some)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6017 (gnus-summary-article-sparse-p number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6018 (zerop children))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6019 ;; If we use expunging, and this article is really
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6020 ;; low-scored, then we don't want this article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6021 (when (and gnus-summary-expunge-below
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6022 (< (setq score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6023 (or (cdr (assq number gnus-newsgroup-scored))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6024 gnus-summary-default-score))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6025 gnus-summary-expunge-below))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6026 ;; We increase the expunge-tally here, but that has
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6027 ;; nothing to do with the limits, really.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6028 (incf gnus-newsgroup-expunged-tally)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6029 ;; We also mark as read here, if that's wanted.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6030 (when (and gnus-summary-mark-below
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6031 (< score gnus-summary-mark-below))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6032 (setq gnus-newsgroup-unreads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6033 (delq number gnus-newsgroup-unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6034 (if gnus-newsgroup-auto-expire
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6035 (push number gnus-newsgroup-expirable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6036 (push (cons number gnus-low-score-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6037 gnus-newsgroup-reads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6038 t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6039 ;; Check NoCeM things.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6040 (if (and gnus-use-nocem
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6041 (gnus-nocem-unwanted-article-p
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6042 (mail-header-id (car thread))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6043 (progn
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6044 (setq gnus-newsgroup-reads
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6045 (delq number gnus-newsgroup-unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6046 t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6047 ;; Nope, invisible article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6048 0
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6049 ;; Ok, this article is to be visible, so we add it to the limit
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6050 ;; and return 1.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6051 (push number gnus-newsgroup-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6052 1))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6053
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6054 (defun gnus-expunge-thread (thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6055 "Mark all articles in THREAD as read."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6056 (let* ((number (mail-header-number (car thread))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6057 (incf gnus-newsgroup-expunged-tally)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6058 ;; We also mark as read here, if that's wanted.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6059 (setq gnus-newsgroup-unreads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6060 (delq number gnus-newsgroup-unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6061 (if gnus-newsgroup-auto-expire
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6062 (push number gnus-newsgroup-expirable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6063 (push (cons number gnus-low-score-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6064 gnus-newsgroup-reads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6065 ;; Go recursively through all subthreads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6066 (mapcar 'gnus-expunge-thread (cdr thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6067
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6068 ;; Summary article oriented commands
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6069
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6070 (defun gnus-summary-refer-parent-article (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6071 "Refer parent article N times.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6072 If N is negative, go to ancestor -N instead.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6073 The difference between N and the number of articles fetched is returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6074 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6075 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6076 (let ((skip 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6077 error header ref)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6078 (when (not (natnump n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6079 (setq skip (abs n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6080 n 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6081 (while (and (> n 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6082 (not error))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6083 (setq header (gnus-summary-article-header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6084 (if (and (eq (mail-header-number header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6085 (cdr gnus-article-current))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6086 (equal gnus-newsgroup-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6087 (car gnus-article-current)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6088 ;; If we try to find the parent of the currently
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6089 ;; displayed article, then we take a look at the actual
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6090 ;; References header, since this is slightly more
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6091 ;; reliable than the References field we got from the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6092 ;; server.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6093 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6094 (set-buffer gnus-original-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6095 (nnheader-narrow-to-headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6096 (unless (setq ref (message-fetch-field "references"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6097 (setq ref (message-fetch-field "in-reply-to")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6098 (widen))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6099 (setq ref
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6100 ;; It's not the current article, so we take a bet on
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6101 ;; the value we got from the server.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6102 (mail-header-references header)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6103 (if (and ref
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6104 (not (equal ref "")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6105 (unless (gnus-summary-refer-article (gnus-parent-id ref skip))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6106 (gnus-message 1 "Couldn't find parent"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6107 (gnus-message 1 "No references in article %d"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6108 (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6109 (setq error t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6110 (decf n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6111 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6112 n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6113
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6114 (defun gnus-summary-refer-references ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6115 "Fetch all articles mentioned in the References header.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6116 Return how many articles were fetched."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6117 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6118 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6119 (let ((ref (mail-header-references (gnus-summary-article-header)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6120 (current (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6121 (n 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6122 (if (or (not ref)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6123 (equal ref ""))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6124 (error "No References in the current article")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6125 ;; For each Message-ID in the References header...
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6126 (while (string-match "<[^>]*>" ref)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6127 (incf n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6128 ;; ... fetch that article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6129 (gnus-summary-refer-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6130 (prog1 (match-string 0 ref)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6131 (setq ref (substring ref (match-end 0))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6132 (gnus-summary-goto-subject current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6133 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6134 n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6135
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6136 (defun gnus-summary-refer-article (message-id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6137 "Fetch an article specified by MESSAGE-ID."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6138 (interactive "sMessage-ID: ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6139 (when (and (stringp message-id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6140 (not (zerop (length message-id))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6141 ;; Construct the correct Message-ID if necessary.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6142 ;; Suggested by tale@pawl.rpi.edu.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6143 (unless (string-match "^<" message-id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6144 (setq message-id (concat "<" message-id)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6145 (unless (string-match ">$" message-id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6146 (setq message-id (concat message-id ">")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6147 (let* ((header (gnus-id-to-header message-id))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6148 (sparse (and header
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6149 (gnus-summary-article-sparse-p
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6150 (mail-header-number header)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6151 (if header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6152 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6153 ;; The article is present in the buffer, to we just go to it.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6154 (gnus-summary-goto-article
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6155 (mail-header-number header) nil header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6156 (when sparse
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6157 (gnus-summary-update-article (mail-header-number header))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6158 ;; We fetch the article
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6159 (let ((gnus-override-method
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6160 (and (gnus-news-group-p gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6161 gnus-refer-article-method))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6162 number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6163 ;; Start the special refer-article method, if necessary.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6164 (when (and gnus-refer-article-method
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6165 (gnus-news-group-p gnus-newsgroup-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6166 (gnus-check-server gnus-refer-article-method))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6167 ;; Fetch the header, and display the article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6168 (if (setq number (gnus-summary-insert-subject message-id))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6169 (gnus-summary-select-article nil nil nil number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6170 (gnus-message 3 "Couldn't fetch article %s" message-id)))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6171
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6172 (defun gnus-summary-enter-digest-group (&optional force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6173 "Enter an nndoc group based on the current article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6174 If FORCE, force a digest interpretation. If not, try
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6175 to guess what the document format is."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6176 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6177 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6178 (let ((conf gnus-current-window-configuration))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6179 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6180 (gnus-summary-select-article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6181 (setq gnus-current-window-configuration conf)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6182 (let* ((name (format "%s-%d"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6183 (gnus-group-prefixed-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6184 gnus-newsgroup-name (list 'nndoc ""))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6185 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6186 (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6187 gnus-current-article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6188 (ogroup gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6189 (params (append (gnus-info-params (gnus-get-info ogroup))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6190 (list (cons 'to-group ogroup))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6191 (list (cons 'save-article-group ogroup))))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6192 (case-fold-search t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6193 (buf (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6194 dig)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6195 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6196 (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6197 (insert-buffer-substring gnus-original-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6198 ;; Remove lines that may lead nndoc to misinterpret the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6199 ;; document type.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6200 (narrow-to-region
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6201 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6202 (or (search-forward "\n\n" nil t) (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6203 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6204 (delete-matching-lines "^\\(Path\\):\\|^From ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6205 (widen))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6206 (unwind-protect
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6207 (if (gnus-group-read-ephemeral-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6208 name `(nndoc ,name (nndoc-address ,(get-buffer dig))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6209 (nndoc-article-type
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6210 ,(if force 'digest 'guess))) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6211 ;; Make all postings to this group go to the parent group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6212 (nconc (gnus-info-params (gnus-get-info name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6213 params)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6214 ;; Couldn't select this doc group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6215 (switch-to-buffer buf)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6216 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6217 (gnus-configure-windows 'summary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6218 (gnus-message 3 "Article couldn't be entered?"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6219 (kill-buffer dig)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6220
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6221 (defun gnus-summary-read-document (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6222 "Open a new group based on the current article(s).
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6223 This will allow you to read digests and other similar
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6224 documents as newsgroups.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6225 Obeys the standard process/prefix convention."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6226 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6227 (let* ((articles (gnus-summary-work-articles n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6228 (ogroup gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6229 (params (append (gnus-info-params (gnus-get-info ogroup))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6230 (list (cons 'to-group ogroup))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6231 article group egroup groups vgroup)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6232 (while (setq article (pop articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6233 (setq group (format "%s-%d" gnus-newsgroup-name article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6234 (gnus-summary-remove-process-mark article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6235 (when (gnus-summary-display-article article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6236 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6237 (nnheader-temp-write nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6238 (insert-buffer-substring gnus-original-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6239 ;; Remove some headers that may lead nndoc to make
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6240 ;; the wrong guess.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6241 (message-narrow-to-head)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6242 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6243 (delete-matching-lines "^\\(Path\\):\\|^From ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6244 (widen)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6245 (if (setq egroup
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6246 (gnus-group-read-ephemeral-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6247 group `(nndoc ,group (nndoc-address ,(current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6248 (nndoc-article-type guess))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6249 t nil t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6250 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6251 ;; Make all postings to this group go to the parent group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6252 (nconc (gnus-info-params (gnus-get-info egroup))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6253 params)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6254 (push egroup groups))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6255 ;; Couldn't select this doc group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6256 (gnus-error 3 "Article couldn't be entered"))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6257 ;; Now we have selected all the documents.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6258 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6259 ((not groups)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6260 (error "None of the articles could be interpreted as documents"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6261 ((gnus-group-read-ephemeral-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6262 (setq vgroup (format
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6263 "nnvirtual:%s-%s" gnus-newsgroup-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6264 (format-time-string "%Y%m%dT%H%M%S" (current-time))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6265 `(nnvirtual ,vgroup (nnvirtual-component-groups ,groups))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6266 t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6267 (cons (current-buffer) 'summary)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6268 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6269 (error "Couldn't select virtual nndoc group")))))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6270
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6271 (defun gnus-summary-isearch-article (&optional regexp-p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6272 "Do incremental search forward on the current article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6273 If REGEXP-P (the prefix) is non-nil, do regexp isearch."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6274 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6275 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6276 (gnus-summary-select-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6277 (gnus-configure-windows 'article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6278 (gnus-eval-in-buffer-window gnus-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6279 ;;(goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6280 (isearch-forward regexp-p)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6281
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6282 (defun gnus-summary-search-article-forward (regexp &optional backward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6283 "Search for an article containing REGEXP forward.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6284 If BACKWARD, search backward instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6285 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6286 (list (read-string
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6287 (format "Search article %s (regexp%s): "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6288 (if current-prefix-arg "backward" "forward")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6289 (if gnus-last-search-regexp
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6290 (concat ", default " gnus-last-search-regexp)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6291 "")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6292 current-prefix-arg))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6293 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6294 (if (string-equal regexp "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6295 (setq regexp (or gnus-last-search-regexp ""))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6296 (setq gnus-last-search-regexp regexp))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6297 (if (gnus-summary-search-article regexp backward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6298 (gnus-summary-show-thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6299 (error "Search failed: \"%s\"" regexp)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6300
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6301 (defun gnus-summary-search-article-backward (regexp)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6302 "Search for an article containing REGEXP backward."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6303 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6304 (list (read-string
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6305 (format "Search article backward (regexp%s): "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6306 (if gnus-last-search-regexp
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6307 (concat ", default " gnus-last-search-regexp)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6308 "")))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6309 (gnus-summary-search-article-forward regexp 'backward))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6310
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6311 (defun gnus-summary-search-article (regexp &optional backward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6312 "Search for an article containing REGEXP.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6313 Optional argument BACKWARD means do search for backward.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6314 `gnus-select-article-hook' is not called during the search."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6315 (let ((gnus-select-article-hook nil) ;Disable hook.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6316 (gnus-article-display-hook nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6317 (gnus-mark-article-hook nil) ;Inhibit marking as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6318 (gnus-use-article-prefetch nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6319 (gnus-xmas-force-redisplay nil) ;Inhibit XEmacs redisplay.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6320 (sum (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6321 (found nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6322 point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6323 (gnus-save-hidden-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6324 (gnus-summary-select-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6325 (set-buffer gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6326 (when backward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6327 (forward-line -1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6328 (while (not found)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6329 (gnus-message 7 "Searching article: %d..." (cdr gnus-article-current))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6330 (if (if backward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6331 (re-search-backward regexp nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6332 (re-search-forward regexp nil t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6333 ;; We found the regexp.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6334 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6335 (setq found 'found)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6336 (beginning-of-line)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6337 (set-window-start
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6338 (get-buffer-window (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6339 (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6340 (forward-line 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6341 (set-buffer sum)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6342 (setq point (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6343 ;; We didn't find it, so we go to the next article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6344 (set-buffer sum)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6345 (setq found 'not)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6346 (while (eq found 'not)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6347 (if (not (if backward (gnus-summary-find-prev)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6348 (gnus-summary-find-next)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6349 ;; No more articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6350 (setq found t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6351 ;; Select the next article and adjust point.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6352 (unless (gnus-summary-article-sparse-p
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6353 (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6354 (setq found nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6355 (gnus-summary-select-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6356 (set-buffer gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6357 (widen)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6358 (goto-char (if backward (point-max) (point-min))))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6359 (gnus-message 7 ""))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6360 ;; Return whether we found the regexp.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6361 (when (eq found 'found)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6362 (goto-char point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6363 (gnus-summary-show-thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6364 (gnus-summary-goto-subject gnus-current-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6365 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6366 t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6367
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6368 (defun gnus-summary-find-matching (header regexp &optional backward unread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6369 not-case-fold)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6370 "Return a list of all articles that match REGEXP on HEADER.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6371 The search stars on the current article and goes forwards unless
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6372 BACKWARD is non-nil. If BACKWARD is `all', do all articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6373 If UNREAD is non-nil, only unread articles will
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6374 be taken into consideration. If NOT-CASE-FOLD, case won't be folded
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6375 in the comparisons."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6376 (let ((data (if (eq backward 'all) gnus-newsgroup-data
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6377 (gnus-data-find-list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6378 (gnus-summary-article-number) (gnus-data-list backward))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6379 (func `(lambda (h) (,(intern (concat "mail-header-" header)) h)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6380 (case-fold-search (not not-case-fold))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6381 articles d)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6382 (unless (fboundp (intern (concat "mail-header-" header)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6383 (error "%s is not a valid header" header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6384 (while data
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6385 (setq d (car data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6386 (and (or (not unread) ; We want all articles...
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6387 (gnus-data-unread-p d)) ; Or just unreads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6388 (vectorp (gnus-data-header d)) ; It's not a pseudo.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6389 (string-match regexp (funcall func (gnus-data-header d))) ; Match.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6390 (push (gnus-data-number d) articles)) ; Success!
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6391 (setq data (cdr data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6392 (nreverse articles)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6393
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6394 (defun gnus-summary-execute-command (header regexp command &optional backward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6395 "Search forward for an article whose HEADER matches REGEXP and execute COMMAND.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6396 If HEADER is an empty string (or nil), the match is done on the entire
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6397 article. If BACKWARD (the prefix) is non-nil, search backward instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6398 (interactive
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6399 (list (let ((completion-ignore-case t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6400 (completing-read
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6401 "Header name: "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6402 (mapcar (lambda (string) (list string))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6403 '("Number" "Subject" "From" "Lines" "Date"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6404 "Message-ID" "Xref" "References" "Body"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6405 nil 'require-match))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6406 (read-string "Regexp: ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6407 (read-key-sequence "Command: ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6408 current-prefix-arg))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6409 (when (equal header "Body")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6410 (setq header ""))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6411 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6412 ;; Hidden thread subtrees must be searched as well.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6413 (gnus-summary-show-all-threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6414 ;; We don't want to change current point nor window configuration.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6415 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6416 (save-window-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6417 (gnus-message 6 "Executing %s..." (key-description command))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6418 ;; We'd like to execute COMMAND interactively so as to give arguments.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6419 (gnus-execute header regexp
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6420 `(call-interactively ',(key-binding command))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6421 backward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6422 (gnus-message 6 "Executing %s...done" (key-description command)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6423
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6424 (defun gnus-summary-beginning-of-article ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6425 "Scroll the article back to the beginning."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6426 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6427 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6428 (gnus-summary-select-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6429 (gnus-configure-windows 'article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6430 (gnus-eval-in-buffer-window gnus-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6431 (widen)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6432 (goto-char (point-min))
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
6433 (when gnus-page-broken
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6434 (gnus-narrow-to-page))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6435
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6436 (defun gnus-summary-end-of-article ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6437 "Scroll to the end of the article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6438 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6439 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6440 (gnus-summary-select-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6441 (gnus-configure-windows 'article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6442 (gnus-eval-in-buffer-window gnus-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6443 (widen)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6444 (goto-char (point-max))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6445 (recenter -3)
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
6446 (when gnus-page-broken
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6447 (gnus-narrow-to-page))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6448
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6449 (defun gnus-summary-print-article (&optional filename)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6450 "Generate and print a PostScript image of the article buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6451
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6452 If the optional argument FILENAME is nil, send the image to the printer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6453 If FILENAME is a string, save the PostScript image in a file with that
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6454 name. If FILENAME is a number, prompt the user for the name of the file
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6455 to save in."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6456 (interactive (list (ps-print-preprint current-prefix-arg)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6457 (gnus-summary-select-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6458 (gnus-eval-in-buffer-window gnus-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6459 (let ((buffer (generate-new-buffer " *print*")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6460 (unwind-protect
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6461 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6462 (copy-to-buffer buffer (point-min) (point-max))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6463 (set-buffer buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6464 (gnus-article-delete-invisible-text)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6465 (run-hooks 'gnus-ps-print-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6466 (ps-print-buffer-with-faces filename))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6467 (kill-buffer buffer)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6468
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6469 (defun gnus-summary-show-article (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6470 "Force re-fetching of the current article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6471 If ARG (the prefix) is non-nil, show the raw article without any
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6472 article massaging functions being run."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6473 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6474 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6475 (if (not arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6476 ;; Select the article the normal way.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6477 (gnus-summary-select-article nil 'force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6478 ;; Bind the article treatment functions to nil.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6479 (let ((gnus-have-all-headers t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6480 gnus-article-display-hook
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6481 gnus-article-prepare-hook
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6482 gnus-break-pages
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6483 gnus-visual)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6484 (gnus-summary-select-article nil 'force)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6485 (gnus-summary-goto-subject gnus-current-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6486 (gnus-summary-position-point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6487
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6488 (defun gnus-summary-verbose-headers (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6489 "Toggle permanent full header display.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6490 If ARG is a positive number, turn header display on.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6491 If ARG is a negative number, turn header display off."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6492 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6493 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6494 (setq gnus-show-all-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6495 (cond ((or (not (numberp arg))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6496 (zerop arg))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6497 (not gnus-show-all-headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6498 ((natnump arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6499 t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6500 (gnus-summary-show-article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6501
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6502 (defun gnus-summary-toggle-header (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6503 "Show the headers if they are hidden, or hide them if they are shown.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6504 If ARG is a positive number, show the entire header.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6505 If ARG is a negative number, hide the unwanted header lines."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6506 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6507 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6508 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6509 (set-buffer gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6510 (let* ((buffer-read-only nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6511 (inhibit-point-motion-hooks t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6512 (hidden (text-property-any
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6513 (goto-char (point-min)) (search-forward "\n\n")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6514 'invisible t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6515 e)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6516 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6517 (when (search-forward "\n\n" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6518 (delete-region (point-min) (1- (point))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6519 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6520 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6521 (set-buffer gnus-original-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6522 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6523 (setq e (1- (or (search-forward "\n\n" nil t) (point-max)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6524 (insert-buffer-substring gnus-original-article-buffer 1 e)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6525 (let ((article-inhibit-hiding t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6526 (run-hooks 'gnus-article-display-hook))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6527 (when (or (not hidden) (and (numberp arg) (< arg 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6528 (gnus-article-hide-headers)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6529
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6530 (defun gnus-summary-show-all-headers ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6531 "Make all header lines visible."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6532 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6533 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6534 (gnus-article-show-all-headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6535
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6536 (defun gnus-summary-toggle-mime (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6537 "Toggle MIME processing.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6538 If ARG is a positive number, turn MIME processing on."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6539 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6540 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6541 (setq gnus-show-mime
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6542 (if (null arg) (not gnus-show-mime)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6543 (> (prefix-numeric-value arg) 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6544 (gnus-summary-select-article t 'force))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6545
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6546 (defun gnus-summary-caesar-message (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6547 "Caesar rotate the current article by 13.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6548 The numerical prefix specifies how many places to rotate each letter
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6549 forward."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6550 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6551 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6552 (gnus-summary-select-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6553 (let ((mail-header-separator ""))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6554 (gnus-eval-in-buffer-window gnus-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6555 (save-restriction
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6556 (widen)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6557 (let ((start (window-start))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6558 buffer-read-only)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6559 (message-caesar-buffer-body arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6560 (set-window-start (get-buffer-window (current-buffer)) start))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6561
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6562 (defun gnus-summary-stop-page-breaking ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6563 "Stop page breaking in the current article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6564 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6565 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6566 (gnus-summary-select-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6567 (gnus-eval-in-buffer-window gnus-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6568 (widen)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6569 (when (gnus-visual-p 'page-marker)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6570 (let ((buffer-read-only nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6571 (gnus-remove-text-with-property 'gnus-prev)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6572 (gnus-remove-text-with-property 'gnus-next)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6573
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6574 (defun gnus-summary-move-article (&optional n to-newsgroup
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6575 select-method action)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6576 "Move the current article to a different newsgroup.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6577 If N is a positive number, move the N next articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6578 If N is a negative number, move the N previous articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6579 If N is nil and any articles have been marked with the process mark,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6580 move those articles instead.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6581 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6582 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6583 re-spool using this method.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6584
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6585 For this function to work, both the current newsgroup and the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6586 newsgroup that you want to move to have to support the `request-move'
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6587 and `request-accept' functions."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6588 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6589 (unless action
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6590 (setq action 'move))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6591 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6592 ;; Disable marking as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6593 (let (gnus-mark-article-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6594 (save-window-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6595 (gnus-summary-select-article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6596 ;; Check whether the source group supports the required functions.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6597 (cond ((and (eq action 'move)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6598 (not (gnus-check-backend-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6599 'request-move-article gnus-newsgroup-name)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6600 (error "The current group does not support article moving"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6601 ((and (eq action 'crosspost)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6602 (not (gnus-check-backend-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6603 'request-replace-article gnus-newsgroup-name)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6604 (error "The current group does not support article editing")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6605 (let ((articles (gnus-summary-work-articles n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6606 (prefix (gnus-group-real-prefix gnus-newsgroup-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6607 (names '((move "Move" "Moving")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6608 (copy "Copy" "Copying")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6609 (crosspost "Crosspost" "Crossposting")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6610 (copy-buf (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6611 (nnheader-set-temp-buffer " *copy article*")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6612 art-group to-method new-xref article to-groups)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6613 (unless (assq action names)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6614 (error "Unknown action %s" action))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6615 ;; Read the newsgroup name.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6616 (when (and (not to-newsgroup)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6617 (not select-method))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6618 (setq to-newsgroup
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6619 (gnus-read-move-group-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6620 (cadr (assq action names))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6621 (symbol-value (intern (format "gnus-current-%s-group" action)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6622 articles prefix))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6623 (set (intern (format "gnus-current-%s-group" action)) to-newsgroup))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6624 (setq to-method (or select-method
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6625 (gnus-group-name-to-method to-newsgroup)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6626 ;; Check the method we are to move this article to...
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6627 (unless (gnus-check-backend-function
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6628 'request-accept-article (car to-method))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6629 (error "%s does not support article copying" (car to-method)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6630 (unless (gnus-check-server to-method)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6631 (error "Can't open server %s" (car to-method)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6632 (gnus-message 6 "%s to %s: %s..."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6633 (caddr (assq action names))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6634 (or (car select-method) to-newsgroup) articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6635 (while articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6636 (setq article (pop articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6637 (setq
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6638 art-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6639 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6640 ;; Move the article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6641 ((eq action 'move)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6642 (gnus-request-move-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6643 article ; Article to move
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6644 gnus-newsgroup-name ; From newsgroup
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6645 (nth 1 (gnus-find-method-for-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6646 gnus-newsgroup-name)) ; Server
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6647 (list 'gnus-request-accept-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6648 to-newsgroup (list 'quote select-method)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6649 (not articles)) ; Accept form
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6650 (not articles))) ; Only save nov last time
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6651 ;; Copy the article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6652 ((eq action 'copy)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6653 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6654 (set-buffer copy-buf)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6655 (gnus-request-article-this-buffer article gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6656 (gnus-request-accept-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6657 to-newsgroup select-method (not articles))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6658 ;; Crosspost the article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6659 ((eq action 'crosspost)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6660 (let ((xref (message-tokenize-header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6661 (mail-header-xref (gnus-summary-article-header article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6662 " ")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6663 (setq new-xref (concat (gnus-group-real-name gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6664 ":" article))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6665 (unless xref
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6666 (setq xref (list (system-name))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6667 (setq new-xref
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6668 (concat
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6669 (mapconcat 'identity
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6670 (delete "Xref:" (delete new-xref xref))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6671 " ")
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6672 " " new-xref))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6673 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6674 (set-buffer copy-buf)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6675 ;; First put the article in the destination group.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6676 (gnus-request-article-this-buffer article gnus-newsgroup-name)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6677 (when (consp (setq art-group
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6678 (gnus-request-accept-article
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6679 to-newsgroup select-method (not articles))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6680 (setq new-xref (concat new-xref " " (car art-group)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6681 ":" (cdr art-group)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6682 ;; Now we have the new Xrefs header, so we insert
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6683 ;; it and replace the new article.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6684 (nnheader-replace-header "Xref" new-xref)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6685 (gnus-request-replace-article
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6686 (cdr art-group) to-newsgroup (current-buffer))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6687 art-group))))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6688 (cond
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6689 ((not art-group)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6690 (gnus-message 1 "Couldn't %s article %s"
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6691 (cadr (assq action names)) article))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6692 ((and (eq art-group 'junk)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6693 (eq action 'move))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6694 (gnus-summary-mark-article article gnus-canceled-mark)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6695 (gnus-message 4 "Deleted article %s" article))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6696 (t
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6697 (let* ((entry
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6698 (or
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6699 (gnus-gethash (car art-group) gnus-newsrc-hashtb)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6700 (gnus-gethash
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6701 (gnus-group-prefixed-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6702 (car art-group)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6703 (or select-method
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6704 (gnus-find-method-for-group to-newsgroup)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6705 gnus-newsrc-hashtb)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6706 (info (nth 2 entry))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6707 (to-group (gnus-info-group info)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6708 ;; Update the group that has been moved to.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6709 (when (and info
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6710 (memq action '(move copy)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6711 (unless (member to-group to-groups)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6712 (push to-group to-groups))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6713
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6714 (unless (memq article gnus-newsgroup-unreads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6715 (gnus-info-set-read
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6716 info (gnus-add-to-range (gnus-info-read info)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6717 (list (cdr art-group)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6718
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6719 ;; Copy any marks over to the new group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6720 (let ((marks gnus-article-mark-lists)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6721 (to-article (cdr art-group)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6722
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6723 ;; See whether the article is to be put in the cache.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6724 (when gnus-use-cache
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6725 (gnus-cache-possibly-enter-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6726 to-group to-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6727 (let ((header (copy-sequence
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6728 (gnus-summary-article-header article))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6729 (mail-header-set-number header to-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6730 header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6731 (memq article gnus-newsgroup-marked)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6732 (memq article gnus-newsgroup-dormant)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6733 (memq article gnus-newsgroup-unreads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6734
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6735 (when (and (equal to-group gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6736 (not (memq article gnus-newsgroup-unreads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6737 ;; Mark this article as read in this group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6738 (push (cons to-article gnus-read-mark) gnus-newsgroup-reads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6739 (setcdr (gnus-active to-group) to-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6740 (setcdr gnus-newsgroup-active to-article))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6741
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6742 (while marks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6743 (when (memq article (symbol-value
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6744 (intern (format "gnus-newsgroup-%s"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6745 (caar marks)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6746 ;; If the other group is the same as this group,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6747 ;; then we have to add the mark to the list.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6748 (when (equal to-group gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6749 (set (intern (format "gnus-newsgroup-%s" (caar marks)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6750 (cons to-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6751 (symbol-value
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6752 (intern (format "gnus-newsgroup-%s"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6753 (caar marks)))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6754 ;; Copy the marks to other group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6755 (gnus-add-marked-articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6756 to-group (cdar marks) (list to-article) info))
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
6757 (setq marks (cdr marks)))
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
6758
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
6759 (gnus-dribble-enter
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
6760 (concat "(gnus-group-set-info '"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
6761 (gnus-prin1-to-string (gnus-get-info to-group))
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 118
diff changeset
6762 ")"))))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6763
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6764 ;; Update the Xref header in this article to point to
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6765 ;; the new crossposted article we have just created.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6766 (when (eq action 'crosspost)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6767 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6768 (set-buffer copy-buf)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6769 (gnus-request-article-this-buffer article gnus-newsgroup-name)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6770 (nnheader-replace-header "Xref" new-xref)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6771 (gnus-request-replace-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6772 article gnus-newsgroup-name (current-buffer)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6773
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6774 (gnus-summary-goto-subject article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6775 (when (eq action 'move)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
6776 (gnus-summary-mark-article article gnus-canceled-mark))))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6777 (gnus-summary-remove-process-mark article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6778 ;; Re-activate all groups that have been moved to.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6779 (while to-groups
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6780 (gnus-activate-group (pop to-groups)))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6781
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6782 (gnus-kill-buffer copy-buf)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6783 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6784 (gnus-set-mode-line 'summary)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6785
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6786 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6787 "Move the current article to a different newsgroup.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6788 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6789 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6790 re-spool using this method."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6791 (interactive "P")
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
6792 (gnus-summary-move-article n to-newsgroup select-method 'copy))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6793
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6794 (defun gnus-summary-crosspost-article (&optional n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6795 "Crosspost the current article to some other group."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6796 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6797 (gnus-summary-move-article n nil nil 'crosspost))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6798
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6799 (defcustom gnus-summary-respool-default-method nil
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6800 "Default method for respooling an article.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6801 If nil, use to the current newsgroup method."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6802 :type 'gnus-select-method-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6803 :group 'gnus-summary-mail)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6804
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6805 (defun gnus-summary-respool-article (&optional n method)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6806 "Respool the current article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6807 The article will be squeezed through the mail spooling process again,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6808 which means that it will be put in some mail newsgroup or other
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6809 depending on `nnmail-split-methods'.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6810 If N is a positive number, respool the N next articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6811 If N is a negative number, respool the N previous articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6812 If N is nil and any articles have been marked with the process mark,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6813 respool those articles instead.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6814
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6815 Respooling can be done both from mail groups and \"real\" newsgroups.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6816 In the former case, the articles in question will be moved from the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6817 current group into whatever groups they are destined to. In the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6818 latter case, they will be copied into the relevant groups."
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6819 (interactive
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6820 (list current-prefix-arg
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6821 (let* ((methods (gnus-methods-using 'respool))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6822 (methname
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6823 (symbol-name (or gnus-summary-respool-default-method
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6824 (car (gnus-find-method-for-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6825 gnus-newsgroup-name)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6826 (method
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6827 (gnus-completing-read
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6828 methname "What backend do you want to use when respooling?"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6829 methods nil t nil 'gnus-mail-method-history))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6830 ms)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6831 (cond
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6832 ((zerop (length (setq ms (gnus-servers-using-backend
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6833 (intern method)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6834 (list (intern method) ""))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6835 ((= 1 (length ms))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6836 (car ms))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6837 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6838 (let ((ms-alist (mapcar (lambda (m) (cons (cadr m) m)) ms)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6839 (cdr (assoc (completing-read "Server name: " ms-alist nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6840 ms-alist))))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6841 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6842 (unless method
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6843 (error "No method given for respooling"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6844 (if (assoc (symbol-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6845 (car (gnus-find-method-for-group gnus-newsgroup-name)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6846 (gnus-methods-using 'respool))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6847 (gnus-summary-move-article n nil method)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6848 (gnus-summary-copy-article n nil method)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6849
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6850 (defun gnus-summary-import-article (file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6851 "Import a random file into a mail newsgroup."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6852 (interactive "fImport file: ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6853 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6854 (let ((group gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6855 (now (current-time))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6856 atts lines)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6857 (unless (gnus-check-backend-function 'request-accept-article group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6858 (error "%s does not support article importing" group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6859 (or (file-readable-p file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6860 (not (file-regular-p file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6861 (error "Can't read %s" file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6862 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6863 (set-buffer (get-buffer-create " *import file*"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6864 (buffer-disable-undo (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6865 (erase-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6866 (insert-file-contents file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6867 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6868 (unless (nnheader-article-p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6869 ;; This doesn't look like an article, so we fudge some headers.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6870 (setq atts (file-attributes file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6871 lines (count-lines (point-min) (point-max)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6872 (insert "From: " (read-string "From: ") "\n"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6873 "Subject: " (read-string "Subject: ") "\n"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6874 "Date: " (timezone-make-date-arpa-standard
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6875 (current-time-string (nth 5 atts))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6876 (current-time-zone now)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6877 (current-time-zone now))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6878 "\n"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6879 "Message-ID: " (message-make-message-id) "\n"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6880 "Lines: " (int-to-string lines) "\n"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6881 "Chars: " (int-to-string (nth 7 atts)) "\n\n"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6882 (gnus-request-accept-article group nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6883 (kill-buffer (current-buffer)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6884
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6885 (defun gnus-summary-article-posted-p ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6886 "Say whether the current (mail) article is available from `gnus-select-method' as well.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6887 This will be the case if the article has both been mailed and posted."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6888 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6889 (let ((id (mail-header-references (gnus-summary-article-header)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6890 (gnus-override-method
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6891 (or gnus-refer-article-method gnus-select-method)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6892 (if (gnus-request-head id "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6893 (gnus-message 2 "The current message was found on %s"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6894 gnus-override-method)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6895 (gnus-message 2 "The current message couldn't be found on %s"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6896 gnus-override-method)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6897 nil)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6898
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6899 (defun gnus-summary-expire-articles (&optional now)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6900 "Expire all articles that are marked as expirable in the current group."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6901 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6902 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6903 (when (gnus-check-backend-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6904 'request-expire-articles gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6905 ;; This backend supports expiry.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6906 (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6907 (expirable (if total
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6908 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6909 ;; We need to update the info for
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6910 ;; this group for `gnus-list-of-read-articles'
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6911 ;; to give us the right answer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6912 (run-hooks 'gnus-exit-group-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6913 (gnus-summary-update-info)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6914 (gnus-list-of-read-articles gnus-newsgroup-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6915 (setq gnus-newsgroup-expirable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6916 (sort gnus-newsgroup-expirable '<))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6917 (expiry-wait (if now 'immediate
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6918 (gnus-group-find-parameter
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6919 gnus-newsgroup-name 'expiry-wait)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6920 es)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6921 (when expirable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6922 ;; There are expirable articles in this group, so we run them
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6923 ;; through the expiry process.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6924 (gnus-message 6 "Expiring articles...")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6925 ;; The list of articles that weren't expired is returned.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6926 (if expiry-wait
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6927 (let ((nnmail-expiry-wait-function nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6928 (nnmail-expiry-wait expiry-wait))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6929 (setq es (gnus-request-expire-articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6930 expirable gnus-newsgroup-name)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6931 (setq es (gnus-request-expire-articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6932 expirable gnus-newsgroup-name)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6933 (unless total
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6934 (setq gnus-newsgroup-expirable es))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6935 ;; We go through the old list of expirable, and mark all
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6936 ;; really expired articles as nonexistent.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6937 (unless (eq es expirable) ;If nothing was expired, we don't mark.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6938 (let ((gnus-use-cache nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6939 (while expirable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6940 (unless (memq (car expirable) es)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6941 (when (gnus-data-find (car expirable))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6942 (gnus-summary-mark-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6943 (car expirable) gnus-canceled-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6944 (setq expirable (cdr expirable)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6945 (gnus-message 6 "Expiring articles...done")))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6946
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6947 (defun gnus-summary-expire-articles-now ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6948 "Expunge all expirable articles in the current group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6949 This means that *all* articles that are marked as expirable will be
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6950 deleted forever, right now."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6951 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6952 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6953 (or gnus-expert-user
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6954 (gnus-yes-or-no-p
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6955 "Are you really, really, really sure you want to delete all these messages? ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6956 (error "Phew!"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6957 (gnus-summary-expire-articles t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6958
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6959 ;; Suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6960 (defun gnus-summary-delete-article (&optional n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6961 "Delete the N next (mail) articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6962 This command actually deletes articles. This is not a marking
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6963 command. The article will disappear forever from your life, never to
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6964 return.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6965 If N is negative, delete backwards.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6966 If N is nil and articles have been marked with the process mark,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6967 delete these instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6968 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6969 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6970 (unless (gnus-check-backend-function 'request-expire-articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6971 gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6972 (error "The current newsgroup does not support article deletion."))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6973 ;; Compute the list of articles to delete.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6974 (let ((articles (gnus-summary-work-articles n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6975 not-deleted)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6976 (if (and gnus-novice-user
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6977 (not (gnus-yes-or-no-p
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6978 (format "Do you really want to delete %s forever? "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6979 (if (> (length articles) 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6980 (format "these %s articles" (length articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6981 "this article")))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6982 ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6983 ;; Delete the articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6984 (setq not-deleted (gnus-request-expire-articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6985 articles gnus-newsgroup-name 'force))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6986 (while articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6987 (gnus-summary-remove-process-mark (car articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6988 ;; The backend might not have been able to delete the article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6989 ;; after all.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6990 (unless (memq (car articles) not-deleted)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6991 (gnus-summary-mark-article (car articles) gnus-canceled-mark))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6992 (setq articles (cdr articles)))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6993 (when not-deleted
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
6994 (gnus-message 4 "Couldn't delete articles %s" not-deleted)))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6995 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6996 (gnus-set-mode-line 'summary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6997 not-deleted))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6998
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
6999 (defun gnus-summary-edit-article (&optional force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7000 "Edit the current article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7001 This will have permanent effect only in mail groups.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7002 If FORCE is non-nil, allow editing of articles even in read-only
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
7003 groups."
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7004 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7005 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7006 (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7007 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7008 (when (and (not force)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7009 (gnus-group-read-only-p))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7010 (error "The current newsgroup does not support article editing."))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7011 ;; Select article if needed.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7012 (unless (eq (gnus-summary-article-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7013 gnus-current-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7014 (gnus-summary-select-article t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7015 (gnus-article-edit-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7016 `(lambda ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7017 (gnus-summary-edit-article-done
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7018 ,(or (mail-header-references gnus-current-headers) "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7019 ,(gnus-group-read-only-p) ,gnus-summary-buffer)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7020
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7021 (defalias 'gnus-summary-edit-article-postpone 'gnus-article-edit-exit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7022
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7023 (defun gnus-summary-edit-article-done (&optional references read-only buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7024 "Make edits to the current article permanent."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7025 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7026 ;; Replace the article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7027 (if (and (not read-only)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7028 (not (gnus-request-replace-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7029 (cdr gnus-article-current) (car gnus-article-current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7030 (current-buffer))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7031 (error "Couldn't replace article.")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7032 ;; Update the summary buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7033 (if (and references
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7034 (equal (message-tokenize-header references " ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7035 (message-tokenize-header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7036 (or (message-fetch-field "references") "") " ")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7037 ;; We only have to update this line.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7038 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7039 (save-restriction
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7040 (message-narrow-to-head)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7041 (let ((head (buffer-string))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7042 header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7043 (nnheader-temp-write nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7044 (insert (format "211 %d Article retrieved.\n"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7045 (cdr gnus-article-current)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7046 (insert head)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7047 (insert ".\n")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7048 (let ((nntp-server-buffer (current-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7049 (setq header (car (gnus-get-newsgroup-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7050 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7051 (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7052 gnus-newsgroup-dependencies)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7053 t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7054 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7055 (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7056 (gnus-data-set-header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7057 (gnus-data-find (cdr gnus-article-current))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7058 header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7059 (gnus-summary-update-article-line
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7060 (cdr gnus-article-current) header))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7061 ;; Update threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7062 (set-buffer (or buffer gnus-summary-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7063 (gnus-summary-update-article (cdr gnus-article-current)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7064 ;; Prettify the article buffer again.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7065 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7066 (set-buffer gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7067 (run-hooks 'gnus-article-display-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7068 (set-buffer gnus-original-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7069 (gnus-request-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7070 (cdr gnus-article-current) (car gnus-article-current) (current-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7071 ;; Prettify the summary buffer line.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7072 (when (gnus-visual-p 'summary-highlight 'highlight)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7073 (run-hooks 'gnus-visual-mark-article-hook))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7074
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7075 (defun gnus-summary-edit-wash (key)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7076 "Perform editing command in the article buffer."
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
7077 (interactive
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7078 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7079 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7080 (message "%s" (concat (this-command-keys) "- "))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7081 (read-char))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7082 (message "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7083 (gnus-summary-edit-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7084 (execute-kbd-macro (concat (this-command-keys) key))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7085 (gnus-article-edit-done))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7086
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7087 ;;; Respooling
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7088
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
7089 (defun gnus-summary-respool-query (&optional silent)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7090 "Query where the respool algorithm would put this article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7091 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7092 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7093 (let (gnus-mark-article-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7094 (gnus-summary-select-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7095 (save-excursion
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
7096 (set-buffer gnus-original-article-buffer)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7097 (save-restriction
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
7098 (message-narrow-to-head)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
7099 (let ((groups (nnmail-article-group 'identity)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
7100 (unless silent
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
7101 (if groups
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
7102 (message "This message would go to %s"
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
7103 (mapconcat 'car groups ", "))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
7104 (message "This message would go to no groups"))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
7105 groups))))))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7106
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7107 ;; Summary marking commands.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7108
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7109 (defun gnus-summary-kill-same-subject-and-select (&optional unmark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7110 "Mark articles which has the same subject as read, and then select the next.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7111 If UNMARK is positive, remove any kind of mark.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7112 If UNMARK is negative, tick articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7113 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7114 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7115 (when unmark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7116 (setq unmark (prefix-numeric-value unmark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7117 (let ((count
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7118 (gnus-summary-mark-same-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7119 (gnus-summary-article-subject) unmark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7120 ;; Select next unread article. If auto-select-same mode, should
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7121 ;; select the first unread article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7122 (gnus-summary-next-article t (and gnus-auto-select-same
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7123 (gnus-summary-article-subject)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7124 (gnus-message 7 "%d article%s marked as %s"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7125 count (if (= count 1) " is" "s are")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7126 (if unmark "unread" "read"))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7127
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7128 (defun gnus-summary-kill-same-subject (&optional unmark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7129 "Mark articles which has the same subject as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7130 If UNMARK is positive, remove any kind of mark.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7131 If UNMARK is negative, tick articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7132 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7133 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7134 (when unmark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7135 (setq unmark (prefix-numeric-value unmark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7136 (let ((count
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7137 (gnus-summary-mark-same-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7138 (gnus-summary-article-subject) unmark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7139 ;; If marked as read, go to next unread subject.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7140 (when (null unmark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7141 ;; Go to next unread subject.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7142 (gnus-summary-next-subject 1 t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7143 (gnus-message 7 "%d articles are marked as %s"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7144 count (if unmark "unread" "read"))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7145
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7146 (defun gnus-summary-mark-same-subject (subject &optional unmark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7147 "Mark articles with same SUBJECT as read, and return marked number.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7148 If optional argument UNMARK is positive, remove any kinds of marks.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7149 If optional argument UNMARK is negative, mark articles as unread instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7150 (let ((count 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7151 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7152 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7153 ((null unmark) ; Mark as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7154 (while (and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7155 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7156 (gnus-summary-mark-article-as-read gnus-killed-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7157 (gnus-summary-show-thread) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7158 (gnus-summary-find-subject subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7159 (setq count (1+ count))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7160 ((> unmark 0) ; Tick.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7161 (while (and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7162 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7163 (gnus-summary-mark-article-as-unread gnus-ticked-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7164 (gnus-summary-show-thread) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7165 (gnus-summary-find-subject subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7166 (setq count (1+ count))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7167 (t ; Mark as unread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7168 (while (and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7169 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7170 (gnus-summary-mark-article-as-unread gnus-unread-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7171 (gnus-summary-show-thread) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7172 (gnus-summary-find-subject subject))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7173 (setq count (1+ count)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7174 (gnus-set-mode-line 'summary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7175 ;; Return the number of marked articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7176 count)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7177
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7178 (defun gnus-summary-mark-as-processable (n &optional unmark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7179 "Set the process mark on the next N articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7180 If N is negative, mark backward instead. If UNMARK is non-nil, remove
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7181 the process mark instead. The difference between N and the actual
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7182 number of articles marked is returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7183 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7184 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7185 (let ((backward (< n 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7186 (n (abs n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7187 (while (and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7188 (> n 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7189 (if unmark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7190 (gnus-summary-remove-process-mark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7191 (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7192 (gnus-summary-set-process-mark (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7193 (zerop (gnus-summary-next-subject (if backward -1 1) nil t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7194 (setq n (1- n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7195 (when (/= 0 n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7196 (gnus-message 7 "No more articles"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7197 (gnus-summary-recenter)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7198 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7199 n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7200
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7201 (defun gnus-summary-unmark-as-processable (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7202 "Remove the process mark from the next N articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7203 If N is negative, mark backward instead. The difference between N and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7204 the actual number of articles marked is returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7205 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7206 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7207 (gnus-summary-mark-as-processable n t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7208
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7209 (defun gnus-summary-unmark-all-processable ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7210 "Remove the process mark from all articles."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7211 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7212 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7213 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7214 (while gnus-newsgroup-processable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7215 (gnus-summary-remove-process-mark (car gnus-newsgroup-processable))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7216 (gnus-summary-position-point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7217
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7218 (defun gnus-summary-mark-as-expirable (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7219 "Mark N articles forward as expirable.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7220 If N is negative, mark backward instead. The difference between N and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7221 the actual number of articles marked is returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7222 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7223 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7224 (gnus-summary-mark-forward n gnus-expirable-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7225
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7226 (defun gnus-summary-mark-article-as-replied (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7227 "Mark ARTICLE replied and update the summary line."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7228 (push article gnus-newsgroup-replied)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7229 (let ((buffer-read-only nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7230 (when (gnus-summary-goto-subject article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7231 (gnus-summary-update-secondary-mark article))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7232
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7233 (defun gnus-summary-set-bookmark (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7234 "Set a bookmark in current article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7235 (interactive (list (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7236 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7237 (when (or (not (get-buffer gnus-article-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7238 (not gnus-current-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7239 (not gnus-article-current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7240 (not (equal gnus-newsgroup-name (car gnus-article-current))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7241 (error "No current article selected"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7242 ;; Remove old bookmark, if one exists.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7243 (let ((old (assq article gnus-newsgroup-bookmarks)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7244 (when old
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7245 (setq gnus-newsgroup-bookmarks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7246 (delq old gnus-newsgroup-bookmarks))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7247 ;; Set the new bookmark, which is on the form
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7248 ;; (article-number . line-number-in-body).
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7249 (push
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7250 (cons article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7251 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7252 (set-buffer gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7253 (count-lines
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7254 (min (point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7255 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7256 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7257 (search-forward "\n\n" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7258 (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7259 (point))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7260 gnus-newsgroup-bookmarks)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7261 (gnus-message 6 "A bookmark has been added to the current article."))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7262
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7263 (defun gnus-summary-remove-bookmark (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7264 "Remove the bookmark from the current article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7265 (interactive (list (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7266 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7267 ;; Remove old bookmark, if one exists.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7268 (let ((old (assq article gnus-newsgroup-bookmarks)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7269 (if old
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7270 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7271 (setq gnus-newsgroup-bookmarks
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7272 (delq old gnus-newsgroup-bookmarks))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7273 (gnus-message 6 "Removed bookmark."))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7274 (gnus-message 6 "No bookmark in current article."))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7275
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7276 ;; Suggested by Daniel Quinlan <quinlan@best.com>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7277 (defun gnus-summary-mark-as-dormant (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7278 "Mark N articles forward as dormant.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7279 If N is negative, mark backward instead. The difference between N and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7280 the actual number of articles marked is returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7281 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7282 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7283 (gnus-summary-mark-forward n gnus-dormant-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7284
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7285 (defun gnus-summary-set-process-mark (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7286 "Set the process mark on ARTICLE and update the summary line."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7287 (setq gnus-newsgroup-processable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7288 (cons article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7289 (delq article gnus-newsgroup-processable)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7290 (when (gnus-summary-goto-subject article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7291 (gnus-summary-show-thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7292 (gnus-summary-update-secondary-mark article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7293
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7294 (defun gnus-summary-remove-process-mark (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7295 "Remove the process mark from ARTICLE and update the summary line."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7296 (setq gnus-newsgroup-processable (delq article gnus-newsgroup-processable))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7297 (when (gnus-summary-goto-subject article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7298 (gnus-summary-show-thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7299 (gnus-summary-update-secondary-mark article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7300
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7301 (defun gnus-summary-set-saved-mark (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7302 "Set the process mark on ARTICLE and update the summary line."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7303 (push article gnus-newsgroup-saved)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7304 (when (gnus-summary-goto-subject article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7305 (gnus-summary-update-secondary-mark article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7306
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7307 (defun gnus-summary-mark-forward (n &optional mark no-expire)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7308 "Mark N articles as read forwards.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7309 If N is negative, mark backwards instead. Mark with MARK, ?r by default.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7310 The difference between N and the actual number of articles marked is
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7311 returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7312 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7313 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7314 (let ((backward (< n 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7315 (gnus-summary-goto-unread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7316 (and gnus-summary-goto-unread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7317 (not (eq gnus-summary-goto-unread 'never))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7318 (not (memq mark (list gnus-unread-mark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7319 gnus-ticked-mark gnus-dormant-mark)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7320 (n (abs n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7321 (mark (or mark gnus-del-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7322 (while (and (> n 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7323 (gnus-summary-mark-article nil mark no-expire)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7324 (zerop (gnus-summary-next-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7325 (if backward -1 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7326 (and gnus-summary-goto-unread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7327 (not (eq gnus-summary-goto-unread 'never)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7328 t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7329 (setq n (1- n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7330 (when (/= 0 n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7331 (gnus-message 7 "No more %sarticles" (if mark "" "unread ")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7332 (gnus-summary-recenter)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7333 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7334 (gnus-set-mode-line 'summary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7335 n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7336
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7337 (defun gnus-summary-mark-article-as-read (mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7338 "Mark the current article quickly as read with MARK."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7339 (let ((article (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7340 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7341 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7342 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7343 (push (cons article mark) gnus-newsgroup-reads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7344 ;; Possibly remove from cache, if that is used.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7345 (when gnus-use-cache
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7346 (gnus-cache-enter-remove-article article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7347 ;; Allow the backend to change the mark.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7348 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7349 ;; Check for auto-expiry.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7350 (when (and gnus-newsgroup-auto-expire
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7351 (or (= mark gnus-killed-mark) (= mark gnus-del-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7352 (= mark gnus-catchup-mark) (= mark gnus-low-score-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7353 (= mark gnus-ancient-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7354 (= mark gnus-read-mark) (= mark gnus-souped-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7355 (= mark gnus-duplicate-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7356 (setq mark gnus-expirable-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7357 (push article gnus-newsgroup-expirable))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7358 ;; Set the mark in the buffer.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7359 (gnus-summary-update-mark mark 'unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7360 t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7361
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7362 (defun gnus-summary-mark-article-as-unread (mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7363 "Mark the current article quickly as unread with MARK."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7364 (let ((article (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7365 (if (< article 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7366 (gnus-error 1 "Unmarkable article")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7367 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7368 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7369 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7370 (setq gnus-newsgroup-reads (delq article gnus-newsgroup-reads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7371 (cond ((= mark gnus-ticked-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7372 (push article gnus-newsgroup-marked))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7373 ((= mark gnus-dormant-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7374 (push article gnus-newsgroup-dormant))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7375 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7376 (push article gnus-newsgroup-unreads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7377 (setq gnus-newsgroup-reads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7378 (delq (assq article gnus-newsgroup-reads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7379 gnus-newsgroup-reads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7380
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7381 ;; See whether the article is to be put in the cache.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7382 (and gnus-use-cache
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7383 (vectorp (gnus-summary-article-header article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7384 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7385 (gnus-cache-possibly-enter-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7386 gnus-newsgroup-name article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7387 (gnus-summary-article-header article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7388 (= mark gnus-ticked-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7389 (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7390
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7391 ;; Fix the mark.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7392 (gnus-summary-update-mark mark 'unread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7393 t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7394
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7395 (defun gnus-summary-mark-article (&optional article mark no-expire)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7396 "Mark ARTICLE with MARK. MARK can be any character.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7397 Four MARK strings are reserved: `? ' (unread), `?!' (ticked),
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7398 `??' (dormant) and `?E' (expirable).
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7399 If MARK is nil, then the default character `?D' is used.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7400 If ARTICLE is nil, then the article on the current line will be
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7401 marked."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7402 ;; The mark might be a string.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7403 (when (stringp mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7404 (setq mark (aref mark 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7405 ;; If no mark is given, then we check auto-expiring.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7406 (and (not no-expire)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7407 gnus-newsgroup-auto-expire
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7408 (or (not mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7409 (and (gnus-characterp mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7410 (or (= mark gnus-killed-mark) (= mark gnus-del-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7411 (= mark gnus-catchup-mark) (= mark gnus-low-score-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7412 (= mark gnus-read-mark) (= mark gnus-souped-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7413 (= mark gnus-duplicate-mark))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7414 (setq mark gnus-expirable-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7415 (let* ((mark (or mark gnus-del-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7416 (article (or article (gnus-summary-article-number))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7417 (unless article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7418 (error "No article on current line"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7419 (if (or (= mark gnus-unread-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7420 (= mark gnus-ticked-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7421 (= mark gnus-dormant-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7422 (gnus-mark-article-as-unread article mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7423 (gnus-mark-article-as-read article mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7424
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7425 ;; See whether the article is to be put in the cache.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7426 (and gnus-use-cache
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7427 (not (= mark gnus-canceled-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7428 (vectorp (gnus-summary-article-header article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7429 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7430 (gnus-cache-possibly-enter-article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7431 gnus-newsgroup-name article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7432 (gnus-summary-article-header article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7433 (= mark gnus-ticked-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7434 (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7435
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7436 (when (gnus-summary-goto-subject article nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7437 (let ((buffer-read-only nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7438 (gnus-summary-show-thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7439 ;; Fix the mark.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7440 (gnus-summary-update-mark mark 'unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7441 t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7442
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7443 (defun gnus-summary-update-secondary-mark (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7444 "Update the secondary (read, process, cache) mark."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7445 (gnus-summary-update-mark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7446 (cond ((memq article gnus-newsgroup-processable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7447 gnus-process-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7448 ((memq article gnus-newsgroup-cached)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7449 gnus-cached-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7450 ((memq article gnus-newsgroup-replied)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7451 gnus-replied-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7452 ((memq article gnus-newsgroup-saved)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7453 gnus-saved-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7454 (t gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7455 'replied)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7456 (when (gnus-visual-p 'summary-highlight 'highlight)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7457 (run-hooks 'gnus-summary-update-hook))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7458 t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7459
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7460 (defun gnus-summary-update-mark (mark type)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7461 (let ((forward (cdr (assq type gnus-summary-mark-positions)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7462 (buffer-read-only nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7463 (re-search-backward "[\n\r]" (gnus-point-at-bol) 'move-to-limit)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7464 (when (looking-at "\r")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7465 (incf forward))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7466 (when (and forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7467 (<= (+ forward (point)) (point-max)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7468 ;; Go to the right position on the line.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7469 (goto-char (+ forward (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7470 ;; Replace the old mark with the new mark.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7471 (subst-char-in-region (point) (1+ (point)) (following-char) mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7472 ;; Optionally update the marks by some user rule.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7473 (when (eq type 'unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7474 (gnus-data-set-mark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7475 (gnus-data-find (gnus-summary-article-number)) mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7476 (gnus-summary-update-line (eq mark gnus-unread-mark))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7477
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7478 (defun gnus-mark-article-as-read (article &optional mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7479 "Enter ARTICLE in the pertinent lists and remove it from others."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7480 ;; Make the article expirable.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7481 (let ((mark (or mark gnus-del-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7482 (if (= mark gnus-expirable-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7483 (push article gnus-newsgroup-expirable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7484 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7485 ;; Remove from unread and marked lists.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7486 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7487 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7488 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7489 (push (cons article mark) gnus-newsgroup-reads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7490 ;; Possibly remove from cache, if that is used.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7491 (when gnus-use-cache
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7492 (gnus-cache-enter-remove-article article))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7493
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7494 (defun gnus-mark-article-as-unread (article &optional mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7495 "Enter ARTICLE in the pertinent lists and remove it from others."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7496 (let ((mark (or mark gnus-ticked-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7497 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7498 gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7499 gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7500 gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7501
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7502 ;; Unsuppress duplicates?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7503 (when gnus-suppress-duplicates
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7504 (gnus-dup-unsuppress-article article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7505
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7506 (cond ((= mark gnus-ticked-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7507 (push article gnus-newsgroup-marked))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7508 ((= mark gnus-dormant-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7509 (push article gnus-newsgroup-dormant))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7510 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7511 (push article gnus-newsgroup-unreads)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7512 (setq gnus-newsgroup-reads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7513 (delq (assq article gnus-newsgroup-reads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7514 gnus-newsgroup-reads))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7515
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7516 (defalias 'gnus-summary-mark-as-unread-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7517 'gnus-summary-tick-article-forward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7518 (make-obsolete 'gnus-summary-mark-as-unread-forward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7519 'gnus-summary-tick-article-forward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7520 (defun gnus-summary-tick-article-forward (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7521 "Tick N articles forwards.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7522 If N is negative, tick backwards instead.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7523 The difference between N and the number of articles ticked is returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7524 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7525 (gnus-summary-mark-forward n gnus-ticked-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7526
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7527 (defalias 'gnus-summary-mark-as-unread-backward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7528 'gnus-summary-tick-article-backward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7529 (make-obsolete 'gnus-summary-mark-as-unread-backward
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7530 'gnus-summary-tick-article-backward)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7531 (defun gnus-summary-tick-article-backward (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7532 "Tick N articles backwards.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7533 The difference between N and the number of articles ticked is returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7534 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7535 (gnus-summary-mark-forward (- n) gnus-ticked-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7536
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7537 (defalias 'gnus-summary-mark-as-unread 'gnus-summary-tick-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7538 (make-obsolete 'gnus-summary-mark-as-unread 'gnus-summary-tick-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7539 (defun gnus-summary-tick-article (&optional article clear-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7540 "Mark current article as unread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7541 Optional 1st argument ARTICLE specifies article number to be marked as unread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7542 Optional 2nd argument CLEAR-MARK remove any kinds of mark."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7543 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7544 (gnus-summary-mark-article article (if clear-mark gnus-unread-mark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7545 gnus-ticked-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7546
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7547 (defun gnus-summary-mark-as-read-forward (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7548 "Mark N articles as read forwards.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7549 If N is negative, mark backwards instead.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7550 The difference between N and the actual number of articles marked is
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7551 returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7552 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7553 (gnus-summary-mark-forward n gnus-del-mark t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7554
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7555 (defun gnus-summary-mark-as-read-backward (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7556 "Mark the N articles as read backwards.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7557 The difference between N and the actual number of articles marked is
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7558 returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7559 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7560 (gnus-summary-mark-forward (- n) gnus-del-mark t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7561
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7562 (defun gnus-summary-mark-as-read (&optional article mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7563 "Mark current article as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7564 ARTICLE specifies the article to be marked as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7565 MARK specifies a string to be inserted at the beginning of the line."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7566 (gnus-summary-mark-article article mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7567
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7568 (defun gnus-summary-clear-mark-forward (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7569 "Clear marks from N articles forward.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7570 If N is negative, clear backward instead.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7571 The difference between N and the number of marks cleared is returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7572 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7573 (gnus-summary-mark-forward n gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7574
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7575 (defun gnus-summary-clear-mark-backward (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7576 "Clear marks from N articles backward.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7577 The difference between N and the number of marks cleared is returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7578 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7579 (gnus-summary-mark-forward (- n) gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7580
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7581 (defun gnus-summary-mark-unread-as-read ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7582 "Intended to be used by `gnus-summary-mark-article-hook'."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7583 (when (memq gnus-current-article gnus-newsgroup-unreads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7584 (gnus-summary-mark-article gnus-current-article gnus-read-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7585
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7586 (defun gnus-summary-mark-read-and-unread-as-read ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7587 "Intended to be used by `gnus-summary-mark-article-hook'."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7588 (let ((mark (gnus-summary-article-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7589 (when (or (gnus-unread-mark-p mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7590 (gnus-read-mark-p mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7591 (gnus-summary-mark-article gnus-current-article gnus-read-mark))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7592
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7593 (defun gnus-summary-mark-region-as-read (point mark all)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7594 "Mark all unread articles between point and mark as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7595 If given a prefix, mark all articles between point and mark as read,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7596 even ticked and dormant ones."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7597 (interactive "r\nP")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7598 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7599 (let (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7600 (goto-char point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7601 (beginning-of-line)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7602 (while (and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7603 (< (point) mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7604 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7605 (when (or all
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7606 (memq (setq article (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7607 gnus-newsgroup-unreads))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7608 (gnus-summary-mark-article article gnus-del-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7609 t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7610 (gnus-summary-find-next))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7611
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7612 (defun gnus-summary-mark-below (score mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7613 "Mark articles with score less than SCORE with MARK."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7614 (interactive "P\ncMark: ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7615 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7616 (setq score (if score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7617 (prefix-numeric-value score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7618 (or gnus-summary-default-score 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7619 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7620 (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7621 (goto-char (point-min))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
7622 (while
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7623 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7624 (and (< (gnus-summary-article-score) score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7625 (gnus-summary-mark-article nil mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7626 (gnus-summary-find-next)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7627
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7628 (defun gnus-summary-kill-below (&optional score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7629 "Mark articles with score below SCORE as read."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7630 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7631 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7632 (gnus-summary-mark-below score gnus-killed-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7633
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7634 (defun gnus-summary-clear-above (&optional score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7635 "Clear all marks from articles with score above SCORE."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7636 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7637 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7638 (gnus-summary-mark-above score gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7639
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7640 (defun gnus-summary-tick-above (&optional score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7641 "Tick all articles with score above SCORE."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7642 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7643 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7644 (gnus-summary-mark-above score gnus-ticked-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7645
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7646 (defun gnus-summary-mark-above (score mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7647 "Mark articles with score over SCORE with MARK."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7648 (interactive "P\ncMark: ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7649 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7650 (setq score (if score
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7651 (prefix-numeric-value score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7652 (or gnus-summary-default-score 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7653 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7654 (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7655 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7656 (while (and (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7657 (when (> (gnus-summary-article-score) score)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7658 (gnus-summary-mark-article nil mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7659 t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7660 (gnus-summary-find-next)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7661
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7662 ;; Suggested by Daniel Quinlan <quinlan@best.com>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7663 (defalias 'gnus-summary-show-all-expunged 'gnus-summary-limit-include-expunged)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7664 (defun gnus-summary-limit-include-expunged (&optional no-error)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7665 "Display all the hidden articles that were expunged for low scores."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7666 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7667 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7668 (let ((buffer-read-only nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7669 (let ((scored gnus-newsgroup-scored)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7670 headers h)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7671 (while scored
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7672 (unless (gnus-summary-goto-subject (caar scored))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7673 (and (setq h (gnus-summary-article-header (caar scored)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7674 (< (cdar scored) gnus-summary-expunge-below)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7675 (push h headers)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7676 (setq scored (cdr scored)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7677 (if (not headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7678 (when (not no-error)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7679 (error "No expunged articles hidden."))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7680 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7681 (gnus-summary-prepare-unthreaded (nreverse headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7682 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7683 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7684 t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7685
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7686 (defun gnus-summary-catchup (&optional all quietly to-here not-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7687 "Mark all unread articles in this newsgroup as read.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
7688 If prefix argument ALL is non-nil, ticked and dormant articles will
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7689 also be marked as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7690 If QUIETLY is non-nil, no questions will be asked.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7691 If TO-HERE is non-nil, it should be a point in the buffer. All
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7692 articles before this point will be marked as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7693 Note that this function will only catch up the unread article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7694 in the current summary buffer limitation.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7695 The number of articles marked as read is returned."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7696 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7697 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7698 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7699 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7700 (when (or quietly
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7701 (not gnus-interactive-catchup) ;Without confirmation?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7702 gnus-expert-user
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7703 (gnus-y-or-n-p
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7704 (if all
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7705 "Mark absolutely all articles as read? "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7706 "Mark all unread articles as read? ")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7707 (if (and not-mark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7708 (not gnus-newsgroup-adaptive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7709 (not gnus-newsgroup-auto-expire)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7710 (not gnus-suppress-duplicates))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7711 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7712 (when all
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7713 (setq gnus-newsgroup-marked nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7714 gnus-newsgroup-dormant nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7715 (setq gnus-newsgroup-unreads nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7716 ;; We actually mark all articles as canceled, which we
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7717 ;; have to do when using auto-expiry or adaptive scoring.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7718 (gnus-summary-show-all-threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7719 (when (gnus-summary-first-subject (not all))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7720 (while (and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7721 (if to-here (< (point) to-here) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7722 (gnus-summary-mark-article-as-read gnus-catchup-mark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7723 (gnus-summary-find-next (not all)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7724 (gnus-set-mode-line 'summary))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7725 t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7726 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7727
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7728 (defun gnus-summary-catchup-to-here (&optional all)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7729 "Mark all unticked articles before the current one as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7730 If ALL is non-nil, also mark ticked and dormant articles as read."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7731 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7732 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7733 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7734 (gnus-save-hidden-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7735 (let ((beg (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7736 ;; We check that there are unread articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7737 (when (or all (gnus-summary-find-prev))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7738 (gnus-summary-catchup all t beg)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7739 (gnus-summary-position-point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7740
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7741 (defun gnus-summary-catchup-all (&optional quietly)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7742 "Mark all articles in this newsgroup as read."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7743 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7744 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7745 (gnus-summary-catchup t quietly))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7746
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7747 (defun gnus-summary-catchup-and-exit (&optional all quietly)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7748 "Mark all articles not marked as unread in this newsgroup as read, then exit.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7749 If prefix argument ALL is non-nil, all articles are marked as read."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7750 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7751 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7752 (when (gnus-summary-catchup all quietly nil 'fast)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7753 ;; Select next newsgroup or exit.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7754 (if (eq gnus-auto-select-next 'quietly)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7755 (gnus-summary-next-group nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7756 (gnus-summary-exit))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7757
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7758 (defun gnus-summary-catchup-all-and-exit (&optional quietly)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7759 "Mark all articles in this newsgroup as read, and then exit."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7760 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7761 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7762 (gnus-summary-catchup-and-exit t quietly))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7763
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7764 ;; Suggested by "Arne Eofsson" <arne@hodgkin.mbi.ucla.edu>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7765 (defun gnus-summary-catchup-and-goto-next-group (&optional all)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7766 "Mark all articles in this group as read and select the next group.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7767 If given a prefix, mark all articles, unread as well as ticked, as
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7768 read."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7769 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7770 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7771 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7772 (gnus-summary-catchup all))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7773 (gnus-summary-next-article t nil nil t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7774
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7775 ;; Thread-based commands.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7776
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7777 (defun gnus-summary-articles-in-thread (&optional article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7778 "Return a list of all articles in the current thread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7779 If ARTICLE is non-nil, return all articles in the thread that starts
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7780 with that article."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7781 (let* ((article (or article (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7782 (data (gnus-data-find-list article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7783 (top-level (gnus-data-level (car data)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7784 (top-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7785 (cond ((null gnus-thread-operation-ignore-subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7786 (gnus-simplify-subject-re
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7787 (mail-header-subject (gnus-data-header (car data)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7788 ((eq gnus-thread-operation-ignore-subject 'fuzzy)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7789 (gnus-simplify-subject-fuzzy
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7790 (mail-header-subject (gnus-data-header (car data)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7791 (t nil)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7792 (end-point (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7793 (if (gnus-summary-go-to-next-thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7794 (point) (point-max))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7795 articles)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7796 (while (and data
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7797 (< (gnus-data-pos (car data)) end-point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7798 (when (or (not top-subject)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7799 (string= top-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7800 (if (eq gnus-thread-operation-ignore-subject 'fuzzy)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7801 (gnus-simplify-subject-fuzzy
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7802 (mail-header-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7803 (gnus-data-header (car data))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7804 (gnus-simplify-subject-re
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7805 (mail-header-subject
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7806 (gnus-data-header (car data)))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7807 (push (gnus-data-number (car data)) articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7808 (unless (and (setq data (cdr data))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7809 (> (gnus-data-level (car data)) top-level))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7810 (setq data nil)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7811 ;; Return the list of articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7812 (nreverse articles)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7813
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7814 (defun gnus-summary-rethread-current ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7815 "Rethread the thread the current article is part of."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7816 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7817 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7818 (let* ((gnus-show-threads t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7819 (article (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7820 (id (mail-header-id (gnus-summary-article-header)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7821 (gnus-newsgroup-threads (list (gnus-id-to-thread (gnus-root-id id)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7822 (unless id
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7823 (error "No article on the current line"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7824 (gnus-rebuild-thread id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7825 (gnus-summary-goto-subject article)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7826
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7827 (defun gnus-summary-reparent-thread ()
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
7828 "Make the current article child of the marked (or previous) article.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7829
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7830 Note that the re-threading will only work if `gnus-thread-ignore-subject'
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7831 is non-nil or the Subject: of both articles are the same."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7832 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7833 (unless (not (gnus-group-read-only-p))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7834 (error "The current newsgroup does not support article editing."))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7835 (unless (<= (length gnus-newsgroup-processable) 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7836 (error "No more than one article may be marked."))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7837 (save-window-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7838 (let ((gnus-article-buffer " *reparent*")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7839 (current-article (gnus-summary-article-number))
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
7840 ;; First grab the marked article, otherwise one line up.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7841 (parent-article (if (not (null gnus-newsgroup-processable))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7842 (car gnus-newsgroup-processable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7843 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7844 (if (eq (forward-line -1) 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7845 (gnus-summary-article-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7846 (error "Beginning of summary buffer."))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7847 (unless (not (eq current-article parent-article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7848 (error "An article may not be self-referential."))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
7849 (let ((message-id (mail-header-id
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7850 (gnus-summary-article-header parent-article))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7851 (unless (and message-id (not (equal message-id "")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7852 (error "No message-id in desired parent."))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7853 (gnus-summary-select-article t t nil current-article)
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
7854 (set-buffer gnus-original-article-buffer)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7855 (let ((buf (format "%s" (buffer-string))))
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
7856 (nnheader-temp-write nil
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
7857 (insert buf)
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
7858 (goto-char (point-min))
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
7859 (if (search-forward-regexp "^References: " nil t)
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
7860 (insert message-id " " )
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
7861 (insert "References: " message-id "\n"))
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
7862 (unless (gnus-request-replace-article
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
7863 current-article (car gnus-article-current)
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
7864 (current-buffer))
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 100
diff changeset
7865 (error "Couldn't replace article."))))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7866 (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7867 (gnus-summary-unmark-all-processable)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7868 (gnus-summary-rethread-current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7869 (gnus-message 3 "Article %d is now the child of article %d."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7870 current-article parent-article)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7871
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7872 (defun gnus-summary-toggle-threads (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7873 "Toggle showing conversation threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7874 If ARG is positive number, turn showing conversation threads on."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7875 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7876 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7877 (let ((current (or (gnus-summary-article-number) gnus-newsgroup-end)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7878 (setq gnus-show-threads
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7879 (if (null arg) (not gnus-show-threads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7880 (> (prefix-numeric-value arg) 0)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7881 (gnus-summary-prepare)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7882 (gnus-summary-goto-subject current)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7883 (gnus-message 6 "Threading is now %s" (if gnus-show-threads "on" "off"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7884 (gnus-summary-position-point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7885
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7886 (defun gnus-summary-show-all-threads ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7887 "Show all threads."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7888 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7889 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7890 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7891 (let ((buffer-read-only nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7892 (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7893 (gnus-summary-position-point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7894
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7895 (defun gnus-summary-show-thread ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7896 "Show thread subtrees.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7897 Returns nil if no thread was there to be shown."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7898 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7899 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7900 (let ((buffer-read-only nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7901 (orig (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7902 ;; first goto end then to beg, to have point at beg after let
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7903 (end (progn (end-of-line) (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7904 (beg (progn (beginning-of-line) (point))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7905 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7906 ;; Any hidden lines here?
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7907 (search-forward "\r" end t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7908 (subst-char-in-region beg end ?\^M ?\n t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7909 (goto-char orig)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7910 (gnus-summary-position-point))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7911
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7912 (defun gnus-summary-hide-all-threads ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7913 "Hide all thread subtrees."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7914 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7915 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7916 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7917 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7918 (gnus-summary-hide-thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7919 (while (zerop (gnus-summary-next-thread 1 t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7920 (gnus-summary-hide-thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7921 (gnus-summary-position-point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7922
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7923 (defun gnus-summary-hide-thread ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7924 "Hide thread subtrees.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7925 Returns nil if no threads were there to be hidden."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7926 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7927 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7928 (let ((buffer-read-only nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7929 (start (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7930 (article (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7931 (goto-char start)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7932 ;; Go forward until either the buffer ends or the subthread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7933 ;; ends.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7934 (when (and (not (eobp))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7935 (or (zerop (gnus-summary-next-thread 1 t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7936 (goto-char (point-max))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7937 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7938 (if (and (> (point) start)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7939 (search-backward "\n" start t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7940 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7941 (subst-char-in-region start (point) ?\n ?\^M)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7942 (gnus-summary-goto-subject article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7943 (goto-char start)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7944 nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7945 ;;(gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7946 ))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7947
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7948 (defun gnus-summary-go-to-next-thread (&optional previous)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7949 "Go to the same level (or less) next thread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7950 If PREVIOUS is non-nil, go to previous thread instead.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7951 Return the article number moved to, or nil if moving was impossible."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7952 (let ((level (gnus-summary-thread-level))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7953 (way (if previous -1 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7954 (beg (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7955 (forward-line way)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7956 (while (and (not (eobp))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7957 (< level (gnus-summary-thread-level)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7958 (forward-line way))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7959 (if (eobp)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7960 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7961 (goto-char beg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7962 nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7963 (setq beg (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7964 (prog1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7965 (gnus-summary-article-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7966 (goto-char beg)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7967
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7968 (defun gnus-summary-next-thread (n &optional silent)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7969 "Go to the same level next N'th thread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7970 If N is negative, search backward instead.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7971 Returns the difference between N and the number of skips actually
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7972 done.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7973
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7974 If SILENT, don't output messages."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7975 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7976 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7977 (let ((backward (< n 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7978 (n (abs n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7979 (while (and (> n 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7980 (gnus-summary-go-to-next-thread backward))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7981 (decf n))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
7982 (unless silent
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7983 (gnus-summary-position-point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7984 (when (and (not silent) (/= 0 n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7985 (gnus-message 7 "No more threads"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7986 n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7987
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7988 (defun gnus-summary-prev-thread (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7989 "Go to the same level previous N'th thread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7990 Returns the difference between N and the number of skips actually
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7991 done."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7992 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7993 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7994 (gnus-summary-next-thread (- n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7995
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7996 (defun gnus-summary-go-down-thread ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7997 "Go down one level in the current thread."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7998 (let ((children (gnus-summary-article-children)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
7999 (when children
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8000 (gnus-summary-goto-subject (car children)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8001
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8002 (defun gnus-summary-go-up-thread ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8003 "Go up one level in the current thread."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8004 (let ((parent (gnus-summary-article-parent)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8005 (when parent
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8006 (gnus-summary-goto-subject parent))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8007
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8008 (defun gnus-summary-down-thread (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8009 "Go down thread N steps.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8010 If N is negative, go up instead.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8011 Returns the difference between N and how many steps down that were
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8012 taken."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8013 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8014 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8015 (let ((up (< n 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8016 (n (abs n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8017 (while (and (> n 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8018 (if up (gnus-summary-go-up-thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8019 (gnus-summary-go-down-thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8020 (setq n (1- n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8021 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8022 (when (/= 0 n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8023 (gnus-message 7 "Can't go further"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8024 n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8025
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8026 (defun gnus-summary-up-thread (n)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8027 "Go up thread N steps.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8028 If N is negative, go up instead.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8029 Returns the difference between N and how many steps down that were
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8030 taken."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8031 (interactive "p")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8032 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8033 (gnus-summary-down-thread (- n)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8034
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8035 (defun gnus-summary-top-thread ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8036 "Go to the top of the thread."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8037 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8038 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8039 (while (gnus-summary-go-up-thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8040 (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8041
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8042 (defun gnus-summary-kill-thread (&optional unmark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8043 "Mark articles under current thread as read.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8044 If the prefix argument is positive, remove any kinds of marks.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8045 If the prefix argument is negative, tick articles instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8046 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8047 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8048 (when unmark
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8049 (setq unmark (prefix-numeric-value unmark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8050 (let ((articles (gnus-summary-articles-in-thread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8051 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8052 ;; Expand the thread.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8053 (gnus-summary-show-thread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8054 ;; Mark all the articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8055 (while articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8056 (gnus-summary-goto-subject (car articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8057 (cond ((null unmark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8058 (gnus-summary-mark-article-as-read gnus-killed-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8059 ((> unmark 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8060 (gnus-summary-mark-article-as-unread gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8061 (t
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8062 (gnus-summary-mark-article-as-unread gnus-ticked-mark)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8063 (setq articles (cdr articles))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8064 ;; Hide killed subtrees.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8065 (and (null unmark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8066 gnus-thread-hide-killed
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8067 (gnus-summary-hide-thread))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8068 ;; If marked as read, go to next unread subject.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8069 (when (null unmark)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8070 ;; Go to next unread subject.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8071 (gnus-summary-next-subject 1 t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8072 (gnus-set-mode-line 'summary))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8073
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8074 ;; Summary sorting commands
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8075
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8076 (defun gnus-summary-sort-by-number (&optional reverse)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8077 "Sort the summary buffer by article number.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8078 Argument REVERSE means reverse order."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8079 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8080 (gnus-summary-sort 'number reverse))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8081
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8082 (defun gnus-summary-sort-by-author (&optional reverse)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8083 "Sort the summary buffer by author name alphabetically.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8084 If case-fold-search is non-nil, case of letters is ignored.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8085 Argument REVERSE means reverse order."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8086 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8087 (gnus-summary-sort 'author reverse))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8088
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8089 (defun gnus-summary-sort-by-subject (&optional reverse)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8090 "Sort the summary buffer by subject alphabetically. `Re:'s are ignored.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8091 If case-fold-search is non-nil, case of letters is ignored.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8092 Argument REVERSE means reverse order."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8093 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8094 (gnus-summary-sort 'subject reverse))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8095
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8096 (defun gnus-summary-sort-by-date (&optional reverse)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8097 "Sort the summary buffer by date.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8098 Argument REVERSE means reverse order."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8099 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8100 (gnus-summary-sort 'date reverse))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8101
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8102 (defun gnus-summary-sort-by-score (&optional reverse)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8103 "Sort the summary buffer by score.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8104 Argument REVERSE means reverse order."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8105 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8106 (gnus-summary-sort 'score reverse))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8107
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8108 (defun gnus-summary-sort-by-lines (&optional reverse)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8109 "Sort the summary buffer by article length.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8110 Argument REVERSE means reverse order."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8111 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8112 (gnus-summary-sort 'lines reverse))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8113
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8114 (defun gnus-summary-sort (predicate reverse)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8115 "Sort summary buffer by PREDICATE. REVERSE means reverse order."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8116 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8117 (let* ((thread (intern (format "gnus-thread-sort-by-%s" predicate)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8118 (article (intern (format "gnus-article-sort-by-%s" predicate)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8119 (gnus-thread-sort-functions
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8120 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8121 (if (not reverse)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8122 thread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8123 `(lambda (t1 t2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8124 (,thread t2 t1)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8125 (gnus-article-sort-functions
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8126 (list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8127 (if (not reverse)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8128 article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8129 `(lambda (t1 t2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8130 (,article t2 t1)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8131 (buffer-read-only)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8132 (gnus-summary-prepare-hook nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8133 ;; We do the sorting by regenerating the threads.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8134 (gnus-summary-prepare)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8135 ;; Hide subthreads if needed.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8136 (when (and gnus-show-threads gnus-thread-hide-subtree)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8137 (gnus-summary-hide-all-threads))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8138
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8139 ;; Summary saving commands.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8140
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8141 (defun gnus-summary-save-article (&optional n not-saved)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8142 "Save the current article using the default saver function.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8143 If N is a positive number, save the N next articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8144 If N is a negative number, save the N previous articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8145 If N is nil and any articles have been marked with the process mark,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8146 save those articles instead.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8147 The variable `gnus-default-article-saver' specifies the saver function."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8148 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8149 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8150 (let* ((articles (gnus-summary-work-articles n))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
8151 (save-buffer (save-excursion
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8152 (nnheader-set-temp-buffer " *Gnus Save*")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8153 (num (length articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8154 header article file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8155 (while articles
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8156 (setq header (gnus-summary-article-header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8157 (setq article (pop articles))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8158 (if (not (vectorp header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8159 ;; This is a pseudo-article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8160 (if (assq 'name header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8161 (gnus-copy-file (cdr (assq 'name header)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8162 (gnus-message 1 "Article %d is unsaveable" article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8163 ;; This is a real article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8164 (save-window-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8165 (gnus-summary-select-article t nil nil article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8166 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8167 (set-buffer save-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8168 (erase-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8169 (insert-buffer-substring gnus-original-article-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8170 (setq file (gnus-article-save save-buffer file num))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8171 (gnus-summary-remove-process-mark article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8172 (unless not-saved
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8173 (gnus-summary-set-saved-mark article))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8174 (gnus-kill-buffer save-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8175 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8176 (gnus-set-mode-line 'summary)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8177 n))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8178
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8179 (defun gnus-summary-pipe-output (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8180 "Pipe the current article to a subprocess.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8181 If N is a positive number, pipe the N next articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8182 If N is a negative number, pipe the N previous articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8183 If N is nil and any articles have been marked with the process mark,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8184 pipe those articles instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8185 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8186 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8187 (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8188 (gnus-summary-save-article arg t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8189 (gnus-configure-windows 'pipe))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8190
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8191 (defun gnus-summary-save-article-mail (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8192 "Append the current article to an mail file.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8193 If N is a positive number, save the N next articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8194 If N is a negative number, save the N previous articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8195 If N is nil and any articles have been marked with the process mark,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8196 save those articles instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8197 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8198 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8199 (let ((gnus-default-article-saver 'gnus-summary-save-in-mail))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8200 (gnus-summary-save-article arg)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8201
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8202 (defun gnus-summary-save-article-rmail (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8203 "Append the current article to an rmail file.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8204 If N is a positive number, save the N next articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8205 If N is a negative number, save the N previous articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8206 If N is nil and any articles have been marked with the process mark,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8207 save those articles instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8208 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8209 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8210 (let ((gnus-default-article-saver 'gnus-summary-save-in-rmail))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8211 (gnus-summary-save-article arg)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8212
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8213 (defun gnus-summary-save-article-file (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8214 "Append the current article to a file.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8215 If N is a positive number, save the N next articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8216 If N is a negative number, save the N previous articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8217 If N is nil and any articles have been marked with the process mark,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8218 save those articles instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8219 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8220 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8221 (let ((gnus-default-article-saver 'gnus-summary-save-in-file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8222 (gnus-summary-save-article arg)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8223
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8224 (defun gnus-summary-write-article-file (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8225 "Write the current article to a file, deleting the previous file.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8226 If N is a positive number, save the N next articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8227 If N is a negative number, save the N previous articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8228 If N is nil and any articles have been marked with the process mark,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8229 save those articles instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8230 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8231 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8232 (let ((gnus-default-article-saver 'gnus-summary-write-to-file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8233 (gnus-summary-save-article arg)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8234
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8235 (defun gnus-summary-save-article-body-file (&optional arg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8236 "Append the current article body to a file.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8237 If N is a positive number, save the N next articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8238 If N is a negative number, save the N previous articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8239 If N is nil and any articles have been marked with the process mark,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8240 save those articles instead."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8241 (interactive "P")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8242 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8243 (let ((gnus-default-article-saver 'gnus-summary-save-body-in-file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8244 (gnus-summary-save-article arg)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8245
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8246 (defun gnus-summary-pipe-message (program)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8247 "Pipe the current article through PROGRAM."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8248 (interactive "sProgram: ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8249 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8250 (gnus-summary-select-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8251 (let ((mail-header-separator "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8252 (art-buf (get-buffer gnus-article-buffer)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8253 (gnus-eval-in-buffer-window gnus-article-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8254 (save-restriction
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8255 (widen)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8256 (let ((start (window-start))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8257 buffer-read-only)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8258 (message-pipe-buffer-body program)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8259 (set-window-start (get-buffer-window (current-buffer)) start))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8260
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8261 (defun gnus-get-split-value (methods)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8262 "Return a value based on the split METHODS."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8263 (let (split-name method result match)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8264 (when methods
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8265 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8266 (set-buffer gnus-original-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8267 (save-restriction
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8268 (nnheader-narrow-to-headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8269 (while methods
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8270 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8271 (setq method (pop methods))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8272 (setq match (car method))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8273 (when (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8274 ((stringp match)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8275 ;; Regular expression.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8276 (ignore-errors
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8277 (re-search-forward match nil t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8278 ((gnus-functionp match)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8279 ;; Function.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8280 (save-restriction
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8281 (widen)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8282 (setq result (funcall match gnus-newsgroup-name))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8283 ((consp match)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8284 ;; Form.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8285 (save-restriction
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8286 (widen)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8287 (setq result (eval match)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8288 (setq split-name (append (cdr method) split-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8289 (cond ((stringp result)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8290 (push (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8291 result gnus-article-save-directory)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8292 split-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8293 ((consp result)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8294 (setq split-name (append result split-name)))))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8295 split-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8296
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8297 (defun gnus-valid-move-group-p (group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8298 (and (boundp group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8299 (symbol-name group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8300 (memq 'respool
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8301 (assoc (symbol-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8302 (car (gnus-find-method-for-group
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8303 (symbol-name group))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8304 gnus-valid-select-methods))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8305
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8306 (defun gnus-read-move-group-name (prompt default articles prefix)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8307 "Read a group name."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8308 (let* ((split-name (gnus-get-split-value gnus-move-split-methods))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8309 (minibuffer-confirm-incomplete nil) ; XEmacs
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8310 (prom
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8311 (format "%s %s to:"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8312 prompt
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8313 (if (> (length articles) 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8314 (format "these %d articles" (length articles))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8315 "this article")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8316 (to-newsgroup
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8317 (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8318 ((null split-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8319 (gnus-completing-read default prom
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8320 gnus-active-hashtb
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8321 'gnus-valid-move-group-p
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8322 nil prefix
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8323 'gnus-group-history))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8324 ((= 1 (length split-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8325 (gnus-completing-read (car split-name) prom
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8326 gnus-active-hashtb
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8327 'gnus-valid-move-group-p
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8328 nil nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8329 'gnus-group-history))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8330 (t
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
8331 (gnus-completing-read nil prom
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8332 (mapcar (lambda (el) (list el))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8333 (nreverse split-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8334 nil nil nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8335 'gnus-group-history)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8336 (when to-newsgroup
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8337 (if (or (string= to-newsgroup "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8338 (string= to-newsgroup prefix))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
8339 (setq to-newsgroup default))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
8340 (unless to-newsgroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
8341 (error "No group name entered"))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8342 (or (gnus-active to-newsgroup)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8343 (gnus-activate-group to-newsgroup)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8344 (if (gnus-y-or-n-p (format "No such group: %s. Create it? "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8345 to-newsgroup))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
8346 (or (and (gnus-request-create-group
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8347 to-newsgroup (gnus-group-name-to-method to-newsgroup))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8348 (gnus-activate-group to-newsgroup nil nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8349 (gnus-group-name-to-method
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8350 to-newsgroup)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8351 (error "Couldn't create group %s" to-newsgroup)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8352 (error "No such group: %s" to-newsgroup)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8353 to-newsgroup))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8354
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8355 ;; Summary extract commands
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8356
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8357 (defun gnus-summary-insert-pseudos (pslist &optional not-view)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8358 (let ((buffer-read-only nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8359 (article (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8360 after-article b e)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8361 (unless (gnus-summary-goto-subject article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8362 (error "No such article: %d" article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8363 (gnus-summary-position-point)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8364 ;; If all commands are to be bunched up on one line, we collect
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8365 ;; them here.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8366 (unless gnus-view-pseudos-separately
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8367 (let ((ps (setq pslist (sort pslist 'gnus-pseudos<)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8368 files action)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8369 (while ps
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8370 (setq action (cdr (assq 'action (car ps))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8371 (setq files (list (cdr (assq 'name (car ps)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8372 (while (and ps (cdr ps)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8373 (string= (or action "1")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8374 (or (cdr (assq 'action (cadr ps))) "2")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8375 (push (cdr (assq 'name (cadr ps))) files)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8376 (setcdr ps (cddr ps)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8377 (when files
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8378 (when (not (string-match "%s" action))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8379 (push " " files))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8380 (push " " files)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8381 (when (assq 'execute (car ps))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8382 (setcdr (assq 'execute (car ps))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8383 (funcall (if (string-match "%s" action)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8384 'format 'concat)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8385 action
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8386 (mapconcat
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8387 (lambda (f)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8388 (if (equal f " ")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8389 f
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8390 (gnus-quote-arg-for-sh-or-csh f)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8391 files " ")))))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8392 (setq ps (cdr ps)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8393 (if (and gnus-view-pseudos (not not-view))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8394 (while pslist
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8395 (when (assq 'execute (car pslist))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8396 (gnus-execute-command (cdr (assq 'execute (car pslist)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8397 (eq gnus-view-pseudos 'not-confirm)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8398 (setq pslist (cdr pslist)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8399 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8400 (while pslist
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8401 (setq after-article (or (cdr (assq 'article (car pslist)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8402 (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8403 (gnus-summary-goto-subject after-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8404 (forward-line 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8405 (setq b (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8406 (insert " " (file-name-nondirectory
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8407 (cdr (assq 'name (car pslist))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8408 ": " (or (cdr (assq 'execute (car pslist))) "") "\n")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8409 (setq e (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8410 (forward-line -1) ; back to `b'
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8411 (gnus-add-text-properties
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8412 b (1- e) (list 'gnus-number gnus-reffed-article-number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8413 gnus-mouse-face-prop gnus-mouse-face))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8414 (gnus-data-enter
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8415 after-article gnus-reffed-article-number
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8416 gnus-unread-mark b (car pslist) 0 (- e b))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8417 (push gnus-reffed-article-number gnus-newsgroup-unreads)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8418 (setq gnus-reffed-article-number (1- gnus-reffed-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8419 (setq pslist (cdr pslist)))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8420
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8421 (defun gnus-pseudos< (p1 p2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8422 (let ((c1 (cdr (assq 'action p1)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8423 (c2 (cdr (assq 'action p2))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8424 (and c1 c2 (string< c1 c2))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8425
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8426 (defun gnus-request-pseudo-article (props)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8427 (cond ((assq 'execute props)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8428 (gnus-execute-command (cdr (assq 'execute props)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8429 (let ((gnus-current-article (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8430 (run-hooks 'gnus-mark-article-hook)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8431
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8432 (defun gnus-execute-command (command &optional automatic)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8433 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8434 (gnus-article-setup-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8435 (set-buffer gnus-article-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8436 (setq buffer-read-only nil)
112
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
8437 (let ((command (if automatic command (read-string "Command: " command))))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8438 (erase-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8439 (insert "$ " command "\n\n")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8440 (if gnus-view-pseudo-asynchronously
112
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents: 110
diff changeset
8441 (start-process "gnus-execute" (current-buffer) shell-file-name
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8442 shell-command-switch command)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8443 (call-process shell-file-name nil t nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8444 shell-command-switch command)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8445
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8446 ;; Summary kill commands.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8447
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8448 (defun gnus-summary-edit-global-kill (article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8449 "Edit the \"global\" kill file."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8450 (interactive (list (gnus-summary-article-number)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8451 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8452 (gnus-group-edit-global-kill article))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8453
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8454 (defun gnus-summary-edit-local-kill ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8455 "Edit a local kill file applied to the current newsgroup."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8456 (interactive)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8457 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8458 (setq gnus-current-headers (gnus-summary-article-header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8459 (gnus-set-global-variables)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8460 (gnus-group-edit-local-kill
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8461 (gnus-summary-article-number) gnus-newsgroup-name))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8462
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8463 ;;; Header reading.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8464
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8465 (defun gnus-read-header (id &optional header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8466 "Read the headers of article ID and enter them into the Gnus system."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8467 (let ((group gnus-newsgroup-name)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
8468 (gnus-override-method
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8469 (and (gnus-news-group-p gnus-newsgroup-name)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8470 gnus-refer-article-method))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8471 where)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8472 ;; First we check to see whether the header in question is already
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8473 ;; fetched.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8474 (if (stringp id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8475 ;; This is a Message-ID.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8476 (setq header (or header (gnus-id-to-header id)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8477 ;; This is an article number.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8478 (setq header (or header (gnus-summary-article-header id))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8479 (if (and header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8480 (not (gnus-summary-article-sparse-p (mail-header-number header))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8481 ;; We have found the header.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8482 header
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8483 ;; We have to really fetch the header to this article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8484 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8485 (set-buffer nntp-server-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8486 (when (setq where (gnus-request-head id group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8487 (nnheader-fold-continuation-lines)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8488 (goto-char (point-max))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8489 (insert ".\n")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8490 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8491 (insert "211 ")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8492 (princ (cond
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8493 ((numberp id) id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8494 ((cdr where) (cdr where))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8495 (header (mail-header-number header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8496 (t gnus-reffed-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8497 (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8498 (insert " Article retrieved.\n"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8499 (if (or (not where)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8500 (not (setq header (car (gnus-get-newsgroup-headers nil t)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8501 () ; Malformed head.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8502 (unless (gnus-summary-article-sparse-p (mail-header-number header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8503 (when (and (stringp id)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8504 (not (string= (gnus-group-real-name group)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8505 (car where))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8506 ;; If we fetched by Message-ID and the article came
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8507 ;; from a different group, we fudge some bogus article
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8508 ;; numbers for this article.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8509 (mail-header-set-number header gnus-reffed-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8510 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8511 (set-buffer gnus-summary-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8512 (decf gnus-reffed-article-number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8513 (gnus-remove-header (mail-header-number header))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8514 (push header gnus-newsgroup-headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8515 (setq gnus-current-headers header)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8516 (push (mail-header-number header) gnus-newsgroup-limit)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8517 header)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8518
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8519 (defun gnus-remove-header (number)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8520 "Remove header NUMBER from `gnus-newsgroup-headers'."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8521 (if (and gnus-newsgroup-headers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8522 (= number (mail-header-number (car gnus-newsgroup-headers))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8523 (pop gnus-newsgroup-headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8524 (let ((headers gnus-newsgroup-headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8525 (while (and (cdr headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8526 (not (= number (mail-header-number (cadr headers)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8527 (pop headers))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8528 (when (cdr headers)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8529 (setcdr headers (cddr headers))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8530
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8531 ;;;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8532 ;;; summary highlights
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8533 ;;;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8534
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8535 (defun gnus-highlight-selected-summary ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8536 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8537 ;; Highlight selected article in summary buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8538 (when gnus-summary-selected-face
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8539 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8540 (let* ((beg (progn (beginning-of-line) (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8541 (end (progn (end-of-line) (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8542 ;; Fix by Mike Dugan <dugan@bucrf16.bu.edu>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8543 (from (if (get-text-property beg gnus-mouse-face-prop)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8544 beg
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
8545 (or (next-single-property-change
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8546 beg gnus-mouse-face-prop nil end)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8547 beg)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8548 (to
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8549 (if (= from end)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8550 (- from 2)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8551 (or (next-single-property-change
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8552 from gnus-mouse-face-prop nil end)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8553 end))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8554 ;; If no mouse-face prop on line we will have to = from = end,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8555 ;; so we highlight the entire line instead.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8556 (when (= (+ to 2) from)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8557 (setq from beg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8558 (setq to end))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8559 (if gnus-newsgroup-selected-overlay
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8560 ;; Move old overlay.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8561 (gnus-move-overlay
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8562 gnus-newsgroup-selected-overlay from to (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8563 ;; Create new overlay.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8564 (gnus-overlay-put
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8565 (setq gnus-newsgroup-selected-overlay (gnus-make-overlay from to))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8566 'face gnus-summary-selected-face))))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8567
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8568 ;; New implementation by Christian Limpach <Christian.Limpach@nice.ch>.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8569 (defun gnus-summary-highlight-line ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8570 "Highlight current line according to `gnus-summary-highlight'."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8571 (let* ((list gnus-summary-highlight)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8572 (p (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8573 (end (progn (end-of-line) (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8574 ;; now find out where the line starts and leave point there.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8575 (beg (progn (beginning-of-line) (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8576 (article (gnus-summary-article-number))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8577 (score (or (cdr (assq (or article gnus-current-article)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8578 gnus-newsgroup-scored))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8579 gnus-summary-default-score 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8580 (mark (or (gnus-summary-article-mark) gnus-unread-mark))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8581 (inhibit-read-only t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8582 ;; Eval the cars of the lists until we find a match.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8583 (let ((default gnus-summary-default-score))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8584 (while (and list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8585 (not (eval (caar list))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8586 (setq list (cdr list))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8587 (let ((face (cdar list)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8588 (unless (eq face (get-text-property beg 'face))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
8589 (gnus-put-text-property
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 106
diff changeset
8590 beg end 'face
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8591 (setq face (if (boundp face) (symbol-value face) face)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8592 (when gnus-summary-highlight-line-function
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8593 (funcall gnus-summary-highlight-line-function article face))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8594 (goto-char p)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8595
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8596 (defun gnus-update-read-articles (group unread)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8597 "Update the list of read articles in GROUP."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8598 (let* ((active (or gnus-newsgroup-active (gnus-active group)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8599 (entry (gnus-gethash group gnus-newsrc-hashtb))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8600 (info (nth 2 entry))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8601 (prev 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8602 (unread (sort (copy-sequence unread) '<))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8603 read)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8604 (if (or (not info) (not active))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8605 ;; There is no info on this group if it was, in fact,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8606 ;; killed. Gnus stores no information on killed groups, so
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8607 ;; there's nothing to be done.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8608 ;; One could store the information somewhere temporarily,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8609 ;; perhaps... Hmmm...
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8610 ()
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8611 ;; Remove any negative articles numbers.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8612 (while (and unread (< (car unread) 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8613 (setq unread (cdr unread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8614 ;; Remove any expired article numbers
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8615 (while (and unread (< (car unread) (car active)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8616 (setq unread (cdr unread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8617 ;; Compute the ranges of read articles by looking at the list of
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8618 ;; unread articles.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8619 (while unread
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8620 (when (/= (car unread) prev)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8621 (push (if (= prev (1- (car unread))) prev
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8622 (cons prev (1- (car unread))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8623 read))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8624 (setq prev (1+ (car unread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8625 (setq unread (cdr unread)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8626 (when (<= prev (cdr active))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8627 (push (cons prev (cdr active)) read))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8628 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8629 (set-buffer gnus-group-buffer)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8630 (gnus-undo-register
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8631 `(progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8632 (gnus-info-set-marks ',info ',(gnus-info-marks info) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8633 (gnus-info-set-read ',info ',(gnus-info-read info))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8634 (gnus-get-unread-articles-in-group ',info (gnus-active ,group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8635 (gnus-group-update-group ,group t))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8636 ;; Enter this list into the group info.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8637 (gnus-info-set-read
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8638 info (if (> (length read) 1) (nreverse read) read))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8639 ;; Set the number of unread articles in gnus-newsrc-hashtb.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8640 (gnus-get-unread-articles-in-group info (gnus-active group))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8641 t)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8642
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8643 (defun gnus-offer-save-summaries ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8644 "Offer to save all active summary buffers."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8645 (save-excursion
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8646 (let ((buflist (buffer-list))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8647 buffers bufname)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8648 ;; Go through all buffers and find all summaries.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8649 (while buflist
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8650 (and (setq bufname (buffer-name (car buflist)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8651 (string-match "Summary" bufname)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8652 (save-excursion
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8653 (set-buffer bufname)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8654 ;; We check that this is, indeed, a summary buffer.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8655 (and (eq major-mode 'gnus-summary-mode)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8656 ;; Also make sure this isn't bogus.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8657 gnus-newsgroup-prepared
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8658 ;; Also make sure that this isn't a dead summary buffer.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8659 (not gnus-dead-summary-mode)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8660 (push bufname buffers))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8661 (setq buflist (cdr buflist)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8662 ;; Go through all these summary buffers and offer to save them.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8663 (when buffers
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8664 (map-y-or-n-p
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8665 "Update summary buffer %s? "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8666 (lambda (buf) (switch-to-buffer buf) (gnus-summary-exit))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8667 buffers)))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
8668
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8669 (provide 'gnus-sum)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8670
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8671 (run-hooks 'gnus-sum-load-hook)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8672
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents:
diff changeset
8673 ;;; gnus-sum.el ends here