annotate lisp/gnus/gnus-group.el @ 22:8fc7fe29b841 r19-15b94

Import from CVS: tag r19-15b94
author cvs
date Mon, 13 Aug 2007 08:50:29 +0200
parents d95e72db5c07
children 4103f0995bd7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1 ;;; gnus-group.el --- group mode commands for Gnus
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2 ;; Copyright (C) 1996,97 Free Software Foundation, Inc.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5 ;; Keywords: news
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
12 ;; any later version.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
13
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
17 ;; GNU General Public License for more details.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
18
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
22 ;; Boston, MA 02111-1307, USA.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
23
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
24 ;;; Commentary:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
25
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
26 ;;; Code:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
27
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
28 (require 'gnus)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
29 (require 'gnus-start)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
30 (require 'nnmail)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
31 (require 'gnus-spec)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
32 (require 'gnus-int)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
33 (require 'gnus-range)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
34 (require 'gnus-win)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
35 (require 'gnus-undo)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
36
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
37 (defcustom gnus-group-archive-directory
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
38 "/ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list/"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
39 "*The address of the (ding) archives."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
40 :group 'gnus-group-foreign
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
41 :type 'directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
42
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
43 (defcustom gnus-group-recent-archive-directory
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
44 "/ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list-recent/"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
45 "*The address of the most recent (ding) articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
46 :group 'gnus-group-foreign
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
47 :type 'directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
48
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
49 (defcustom gnus-no-groups-message "No news is no news"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
50 "*Message displayed by Gnus when no groups are available."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
51 :group 'gnus-start
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
52 :type 'string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
53
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
54 (defcustom gnus-keep-same-level nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
55 "*Non-nil means that the next newsgroup after the current will be on the same level.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
56 When you type, for instance, `n' after reading the last article in the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
57 current newsgroup, you will go to the next newsgroup. If this variable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
58 is nil, the next newsgroup will be the next from the group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
59 buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
60 If this variable is non-nil, Gnus will either put you in the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
61 next newsgroup with the same level, or, if no such newsgroup is
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
62 available, the next newsgroup with the lowest possible level higher
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
63 than the current level.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
64 If this variable is `best', Gnus will make the next newsgroup the one
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
65 with the best level."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
66 :group 'gnus-group-levels
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
67 :type '(choice (const nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
68 (const best)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
69 (sexp :tag "other" t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
70
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
71 (defcustom gnus-group-goto-unread t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
72 "*If non-nil, movement commands will go to the next unread and subscribed group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
73 :link '(custom-manual "(gnus)Group Maneuvering")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
74 :group 'gnus-group-various
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
75 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
76
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
77 (defcustom gnus-goto-next-group-when-activating t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
78 "*If non-nil, the \\<gnus-group-mode-map>\\[gnus-group-get-new-news-this-group] command will advance point to the next group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
79 :link '(custom-manual "(gnus)Scanning New Messages")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
80 :group 'gnus-group-various
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
81 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
82
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
83 (defcustom gnus-permanently-visible-groups nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
84 "*Regexp to match groups that should always be listed in the group buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
85 This means that they will still be listed when there are no unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
86 articles in the groups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
87 :group 'gnus-group-listing
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
88 :type 'regexp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
89
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
90 (defcustom gnus-list-groups-with-ticked-articles t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
91 "*If non-nil, list groups that have only ticked articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
92 If nil, only list groups that have unread articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
93 :group 'gnus-group-listing
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
94 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
95
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
96 (defcustom gnus-group-default-list-level gnus-level-subscribed
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
97 "*Default listing level.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
98 Ignored if `gnus-group-use-permanent-levels' is non-nil."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
99 :group 'gnus-group-listing
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
100 :type 'integer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
101
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
102 (defcustom gnus-group-list-inactive-groups t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
103 "*If non-nil, inactive groups will be listed."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
104 :group 'gnus-group-listing
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
105 :group 'gnus-group-levels
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
106 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
107
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
108 (defcustom gnus-group-sort-function 'gnus-group-sort-by-alphabet
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
109 "*Function used for sorting the group buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
110 This function will be called with group info entries as the arguments
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
111 for the groups to be sorted. Pre-made functions include
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
112 `gnus-group-sort-by-alphabet', `gnus-group-sort-by-real-name',
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
113 `gnus-group-sort-by-unread', `gnus-group-sort-by-level',
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
114 `gnus-group-sort-by-score', `gnus-group-sort-by-method', and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
115 `gnus-group-sort-by-rank'.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
116
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
117 This variable can also be a list of sorting functions. In that case,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
118 the most significant sort function should be the last function in the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
119 list."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
120 :group 'gnus-group-listing
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
121 :link '(custom-manual "(gnus)Sorting Groups")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
122 :type '(radio (function-item gnus-group-sort-by-alphabet)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
123 (function-item gnus-group-sort-by-real-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
124 (function-item gnus-group-sort-by-unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
125 (function-item gnus-group-sort-by-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
126 (function-item gnus-group-sort-by-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
127 (function-item gnus-group-sort-by-method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
128 (function-item gnus-group-sort-by-rank)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
129 (function :tag "other" nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
130
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
131 (defcustom gnus-group-line-format "%M\%S\%p\%P\%5y: %(%g%)%l\n"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
132 "*Format of group lines.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
133 It works along the same lines as a normal formatting string,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
134 with some simple extensions.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
135
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
136 %M Only marked articles (character, \"*\" or \" \")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
137 %S Whether the group is subscribed (character, \"U\", \"K\", \"Z\" or \" \")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
138 %L Level of subscribedness (integer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
139 %N Number of unread articles (integer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
140 %I Number of dormant articles (integer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
141 %i Number of ticked and dormant (integer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
142 %T Number of ticked articles (integer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
143 %R Number of read articles (integer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
144 %t Estimated total number of articles (integer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
145 %y Number of unread, unticked articles (integer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
146 %G Group name (string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
147 %g Qualified group name (string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
148 %D Group description (string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
149 %s Select method (string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
150 %o Moderated group (char, \"m\")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
151 %p Process mark (char)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
152 %O Moderated group (string, \"(m)\" or \"\")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
153 %P Topic indentation (string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
154 %m Whether there is new(ish) mail in the group (char, \"%\")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
155 %l Whether there are GroupLens predictions for this group (string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
156 %n Select from where (string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
157 %z A string that look like `<%s:%n>' if a foreign select method is used
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
158 ?d The date the group was last entered.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
159 %u User defined specifier. The next character in the format string should
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
160 be a letter. Gnus will call the function gnus-user-format-function-X,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
161 where X is the letter following %u. The function will be passed the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
162 current header as argument. The function should return a string, which
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
163 will be inserted into the buffer just like information from any other
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
164 group specifier.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
165
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
166 Text between %( and %) will be highlighted with `gnus-mouse-face' when
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
167 the mouse point move inside the area. There can only be one such area.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
168
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
169 Note that this format specification is not always respected. For
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
170 reasons of efficiency, when listing killed groups, this specification
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
171 is ignored altogether. If the spec is changed considerably, your
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
172 output may end up looking strange when listing both alive and killed
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
173 groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
174
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
175 If you use %o or %O, reading the active file will be slower and quite
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
176 a bit of extra memory will be used. %D will also worsen performance.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
177 Also note that if you change the format specification to include any
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
178 of these specs, you must probably re-start Gnus to see them go into
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
179 effect."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
180 :group 'gnus-group-visual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
181 :type 'string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
182
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
183 (defcustom gnus-group-mode-line-format "Gnus: %%b {%M\%:%S}"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
184 "*The format specification for the group mode line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
185 It works along the same lines as a normal formatting string,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
186 with some simple extensions:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
187
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
188 %S The native news server.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
189 %M The native select method.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
190 %: \":\" if %S isn't \"\"."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
191 :group 'gnus-group-visual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
192 :type 'string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
193
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
194 (defcustom gnus-group-mode-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
195 "Hook for Gnus group mode."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
196 :group 'gnus-group-various
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
197 :options '(gnus-topic-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
198 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
199
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
200 (defcustom gnus-group-menu-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
201 "Hook run after the creation of the group mode menu."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
202 :group 'gnus-group-various
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
203 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
204
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
205 (defcustom gnus-group-catchup-group-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
206 "Hook run when catching up a group from the group buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
207 :group 'gnus-group-various
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
208 :link '(custom-manual "(gnus)Group Data")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
209 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
210
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
211 (defcustom gnus-group-update-group-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
212 "Hook called when updating group lines."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
213 :group 'gnus-group-visual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
214 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
215
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
216 (defcustom gnus-group-prepare-function 'gnus-group-prepare-flat
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
217 "*A function that is called to generate the group buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
218 The function is called with three arguments: The first is a number;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
219 all group with a level less or equal to that number should be listed,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
220 if the second is non-nil, empty groups should also be displayed. If
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
221 the third is non-nil, it is a number. No groups with a level lower
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
222 than this number should be displayed.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
223
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
224 The only current function implemented is `gnus-group-prepare-flat'."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
225 :group 'gnus-group-listing
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
226 :type 'function)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
227
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
228 (defcustom gnus-group-prepare-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
229 "Hook called after the group buffer has been generated.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
230 If you want to modify the group buffer, you can use this hook."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
231 :group 'gnus-group-listing
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
232 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
233
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
234 (defcustom gnus-suspend-gnus-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
235 "Hook called when suspending (not exiting) Gnus."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
236 :group 'gnus-exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
237 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
238
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
239 (defcustom gnus-exit-gnus-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
240 "Hook called when exiting Gnus."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
241 :group 'gnus-exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
242 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
243
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
244 (defcustom gnus-after-exiting-gnus-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
245 "Hook called after exiting Gnus."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
246 :group 'gnus-exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
247 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
248
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
249 (defcustom gnus-group-update-hook '(gnus-group-highlight-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
250 "Hook called when a group line is changed.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
251 The hook will not be called if `gnus-visual' is nil.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
252
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
253 The default function `gnus-group-highlight-line' will
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
254 highlight the line according to the `gnus-group-highlight'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
255 variable."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
256 :group 'gnus-group-visual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
257 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
258
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
259 (defcustom gnus-useful-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
260 `(("(ding) mailing list mirrored at sunsite.auc.dk"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
261 "emacs.ding"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
262 (nntp "sunsite.auc.dk"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
263 (nntp-address "sunsite.auc.dk")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
264 ("Gnus help group"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
265 "gnus-help"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
266 (nndoc "gnus-help"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
267 (nndoc-article-type mbox)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
268 (eval `(nndoc-address
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
269 ,(let ((file (nnheader-find-etc-directory
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
270 "gnus-tut.txt" t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
271 (unless file
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
272 (error "Couldn't find doc group"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
273 file))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
274 "Alist of useful group-server pairs."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
275 :group 'gnus-group-listing
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
276 :type '(repeat (list (string :tag "Description")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
277 (string :tag "Name")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
278 (sexp :tag "Method"))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
279
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
280 (defcustom gnus-group-highlight
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
281 '(;; News.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
282 ((and (= unread 0) (not mailp) (eq level 1)) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
283 gnus-group-news-1-empty-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
284 ((and (not mailp) (eq level 1)) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
285 gnus-group-news-1-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
286 ((and (= unread 0) (not mailp) (eq level 2)) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
287 gnus-group-news-2-empty-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
288 ((and (not mailp) (eq level 2)) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
289 gnus-group-news-2-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
290 ((and (= unread 0) (not mailp) (eq level 3)) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
291 gnus-group-news-3-empty-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
292 ((and (not mailp) (eq level 3)) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
293 gnus-group-news-3-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
294 ((and (= unread 0) (not mailp)) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
295 gnus-group-news-low-empty-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
296 ((and (not mailp)) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
297 gnus-group-news-low-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
298 ;; Mail.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
299 ((and (= unread 0) (eq level 1)) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
300 gnus-group-mail-1-empty-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
301 ((eq level 1) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
302 gnus-group-mail-1-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
303 ((and (= unread 0) (eq level 2)) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
304 gnus-group-mail-2-empty-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
305 ((eq level 2) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
306 gnus-group-mail-2-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
307 ((and (= unread 0) (eq level 3)) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
308 gnus-group-mail-3-empty-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
309 ((eq level 3) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
310 gnus-group-mail-3-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
311 ((= unread 0) .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
312 gnus-group-mail-low-empty-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
313 (t .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
314 gnus-group-mail-low-face))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
315 "Controls the highlighting of group buffer lines.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
316
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
317 Below is a list of `Form'/`Face' pairs. When deciding how a a
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
318 particular group line should be displayed, each form is
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
319 evaluated. The content of the face field after the first true form is
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
320 used. You can change how those group lines are displayed by
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
321 editing the face field.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
322
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
323 It is also possible to change and add form fields, but currently that
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
324 requires an understanding of Lisp expressions. Hopefully this will
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
325 change in a future release. For now, you can use the following
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
326 variables in the Lisp expression:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
327
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
328 group: The name of the group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
329 unread: The number of unread articles in the group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
330 method: The select method used.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
331 mailp: Whether it's a mail group or not.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
332 level: The level of the group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
333 score: The score of the group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
334 ticked: The number of ticked articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
335 :group 'gnus-group-visual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
336 :type '(repeat (cons (sexp :tag "Form") face)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
337
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
338 (defcustom gnus-new-mail-mark ?%
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
339 "Mark used for groups with new mail."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
340 :group 'gnus-group-visual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
341 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
342
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
343 ;;; Internal variables
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
344
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
345 (defvar gnus-group-sort-alist-function 'gnus-group-sort-flat
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
346 "Function for sorting the group buffer.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
347
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
348 (defvar gnus-group-sort-selected-function 'gnus-group-sort-selected-flat
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
349 "Function for sorting the selected groups in the group buffer.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
350
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
351 (defvar gnus-group-indentation-function nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
352 (defvar gnus-goto-missing-group-function nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
353 (defvar gnus-group-update-group-function nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
354 (defvar gnus-group-goto-next-group-function nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
355 "Function to override finding the next group after listing groups.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
356
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
357 (defvar gnus-group-edit-buffer nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
358
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
359 (defvar gnus-group-line-format-alist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
360 `((?M gnus-tmp-marked-mark ?c)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
361 (?S gnus-tmp-subscribed ?c)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
362 (?L gnus-tmp-level ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
363 (?N (cond ((eq number t) "*" )
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
364 ((numberp number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
365 (int-to-string
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
366 (+ number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
367 (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
368 (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
369 (t number)) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
370 (?R gnus-tmp-number-of-read ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
371 (?t gnus-tmp-number-total ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
372 (?y gnus-tmp-number-of-unread ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
373 (?I (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked))) ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
374 (?T (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))) ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
375 (?i (+ (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
376 (gnus-range-length (cdr (assq 'tick gnus-tmp-marked)))) ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
377 (?g gnus-tmp-group ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
378 (?G gnus-tmp-qualified-group ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
379 (?c (gnus-short-group-name gnus-tmp-group) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
380 (?D gnus-tmp-newsgroup-description ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
381 (?o gnus-tmp-moderated ?c)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
382 (?O gnus-tmp-moderated-string ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
383 (?p gnus-tmp-process-marked ?c)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
384 (?s gnus-tmp-news-server ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
385 (?n gnus-tmp-news-method ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
386 (?P gnus-group-indentation ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
387 (?l gnus-tmp-grouplens ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
388 (?z gnus-tmp-news-method-string ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
389 (?m (gnus-group-new-mail gnus-tmp-group) ?c)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
390 (?d (gnus-group-timestamp-string gnus-tmp-group) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
391 (?u gnus-tmp-user-defined ?s)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
392
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
393 (defvar gnus-group-mode-line-format-alist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
394 `((?S gnus-tmp-news-server ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
395 (?M gnus-tmp-news-method ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
396 (?u gnus-tmp-user-defined ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
397 (?: gnus-tmp-colon ?s)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
398
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
399 (defvar gnus-topic-topology nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
400 "The complete topic hierarchy.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
401
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
402 (defvar gnus-topic-alist nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
403 "The complete topic-group alist.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
404
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
405 (defvar gnus-group-marked nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
406
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
407 (defvar gnus-group-list-mode nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
408
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
409 ;;;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
410 ;;; Gnus group mode
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
411 ;;;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
412
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
413 (put 'gnus-group-mode 'mode-class 'special)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
414
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
415 (when t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
416 (gnus-define-keys gnus-group-mode-map
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
417 " " gnus-group-read-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
418 "=" gnus-group-select-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
419 "\r" gnus-group-select-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
420 "\M-\r" gnus-group-quick-select-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
421 [(meta control return)] gnus-group-select-group-ephemerally
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
422 "j" gnus-group-jump-to-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
423 "n" gnus-group-next-unread-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
424 "p" gnus-group-prev-unread-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
425 "\177" gnus-group-prev-unread-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
426 [delete] gnus-group-prev-unread-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
427 "N" gnus-group-next-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
428 "P" gnus-group-prev-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
429 "\M-n" gnus-group-next-unread-group-same-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
430 "\M-p" gnus-group-prev-unread-group-same-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
431 "," gnus-group-best-unread-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
432 "." gnus-group-first-unread-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
433 "u" gnus-group-unsubscribe-current-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
434 "U" gnus-group-unsubscribe-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
435 "c" gnus-group-catchup-current
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
436 "C" gnus-group-catchup-current-all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
437 "\M-c" gnus-group-clear-data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
438 "l" gnus-group-list-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
439 "L" gnus-group-list-all-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
440 "m" gnus-group-mail
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
441 "g" gnus-group-get-new-news
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
442 "\M-g" gnus-group-get-new-news-this-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
443 "R" gnus-group-restart
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
444 "r" gnus-group-read-init-file
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
445 "B" gnus-group-browse-foreign-server
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
446 "b" gnus-group-check-bogus-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
447 "F" gnus-find-new-newsgroups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
448 "\C-c\C-d" gnus-group-describe-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
449 "\M-d" gnus-group-describe-all-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
450 "\C-c\C-a" gnus-group-apropos
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
451 "\C-c\M-\C-a" gnus-group-description-apropos
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
452 "a" gnus-group-post-news
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
453 "\ek" gnus-group-edit-local-kill
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
454 "\eK" gnus-group-edit-global-kill
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
455 "\C-k" gnus-group-kill-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
456 "\C-y" gnus-group-yank-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
457 "\C-w" gnus-group-kill-region
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
458 "\C-x\C-t" gnus-group-transpose-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
459 "\C-c\C-l" gnus-group-list-killed
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
460 "\C-c\C-x" gnus-group-expire-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
461 "\C-c\M-\C-x" gnus-group-expire-all-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
462 "V" gnus-version
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
463 "s" gnus-group-save-newsrc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
464 "z" gnus-group-suspend
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
465 "q" gnus-group-exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
466 "Q" gnus-group-quit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
467 "?" gnus-group-describe-briefly
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
468 "\C-c\C-i" gnus-info-find-node
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
469 "\M-e" gnus-group-edit-group-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
470 "^" gnus-group-enter-server-mode
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
471 gnus-mouse-2 gnus-mouse-pick-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
472 "<" beginning-of-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
473 ">" end-of-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
474 "\C-c\C-b" gnus-bug
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
475 "\C-c\C-s" gnus-group-sort-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
476 "t" gnus-topic-mode
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
477 "\C-c\M-g" gnus-activate-all-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
478 "\M-&" gnus-group-universal-argument
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
479 "#" gnus-group-mark-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
480 "\M-#" gnus-group-unmark-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
481
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
482 (gnus-define-keys (gnus-group-mark-map "M" gnus-group-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
483 "m" gnus-group-mark-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
484 "u" gnus-group-unmark-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
485 "w" gnus-group-mark-region
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
486 "m" gnus-group-mark-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
487 "r" gnus-group-mark-regexp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
488 "U" gnus-group-unmark-all-groups)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
489
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
490 (gnus-define-keys (gnus-group-group-map "G" gnus-group-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
491 "d" gnus-group-make-directory-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
492 "h" gnus-group-make-help-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
493 "u" gnus-group-make-useful-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
494 "a" gnus-group-make-archive-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
495 "k" gnus-group-make-kiboze-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
496 "m" gnus-group-make-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
497 "E" gnus-group-edit-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
498 "e" gnus-group-edit-group-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
499 "p" gnus-group-edit-group-parameters
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
500 "v" gnus-group-add-to-virtual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
501 "V" gnus-group-make-empty-virtual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
502 "D" gnus-group-enter-directory
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
503 "f" gnus-group-make-doc-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
504 "w" gnus-group-make-web-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
505 "r" gnus-group-rename-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
506 "c" gnus-group-customize
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
507 "\177" gnus-group-delete-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
508 [delete] gnus-group-delete-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
509
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
510 (gnus-define-keys (gnus-group-soup-map "s" gnus-group-group-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
511 "b" gnus-group-brew-soup
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
512 "w" gnus-soup-save-areas
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
513 "s" gnus-soup-send-replies
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
514 "p" gnus-soup-pack-packet
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
515 "r" nnsoup-pack-replies)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
516
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
517 (gnus-define-keys (gnus-group-sort-map "S" gnus-group-group-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
518 "s" gnus-group-sort-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
519 "a" gnus-group-sort-groups-by-alphabet
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
520 "u" gnus-group-sort-groups-by-unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
521 "l" gnus-group-sort-groups-by-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
522 "v" gnus-group-sort-groups-by-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
523 "r" gnus-group-sort-groups-by-rank
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
524 "m" gnus-group-sort-groups-by-method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
525
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
526 (gnus-define-keys (gnus-group-sort-map "P" gnus-group-group-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
527 "s" gnus-group-sort-selected-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
528 "a" gnus-group-sort-selected-groups-by-alphabet
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
529 "u" gnus-group-sort-selected-groups-by-unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
530 "l" gnus-group-sort-selected-groups-by-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
531 "v" gnus-group-sort-selected-groups-by-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
532 "r" gnus-group-sort-selected-groups-by-rank
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
533 "m" gnus-group-sort-selected-groups-by-method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
534
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
535 (gnus-define-keys (gnus-group-list-map "A" gnus-group-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
536 "k" gnus-group-list-killed
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
537 "z" gnus-group-list-zombies
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
538 "s" gnus-group-list-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
539 "u" gnus-group-list-all-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
540 "A" gnus-group-list-active
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
541 "a" gnus-group-apropos
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
542 "d" gnus-group-description-apropos
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
543 "m" gnus-group-list-matching
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
544 "M" gnus-group-list-all-matching
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
545 "l" gnus-group-list-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
546
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
547 (gnus-define-keys (gnus-group-score-map "W" gnus-group-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
548 "f" gnus-score-flush-cache)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
549
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
550 (gnus-define-keys (gnus-group-help-map "H" gnus-group-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
551 "d" gnus-group-describe-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
552 "f" gnus-group-fetch-faq)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
553
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
554 (gnus-define-keys (gnus-group-sub-map "S" gnus-group-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
555 "l" gnus-group-set-current-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
556 "t" gnus-group-unsubscribe-current-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
557 "s" gnus-group-unsubscribe-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
558 "k" gnus-group-kill-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
559 "y" gnus-group-yank-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
560 "w" gnus-group-kill-region
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
561 "\C-k" gnus-group-kill-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
562 "z" gnus-group-kill-all-zombies))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
563
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
564 (defun gnus-group-make-menu-bar ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
565 (gnus-turn-off-edit-menu 'group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
566 (unless (boundp 'gnus-group-reading-menu)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
567
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
568 (easy-menu-define
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
569 gnus-group-reading-menu gnus-group-mode-map ""
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
570 '("Group"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
571 ["Read" gnus-group-read-group (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
572 ["Select" gnus-group-select-group (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
573 ["See old articles" (gnus-group-select-group 'all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
574 :keys "C-u SPC" :active (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
575 ["Catch up" gnus-group-catchup-current (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
576 ["Catch up all articles" gnus-group-catchup-current-all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
577 (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
578 ["Check for new articles" gnus-group-get-new-news-this-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
579 (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
580 ["Toggle subscription" gnus-group-unsubscribe-current-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
581 (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
582 ["Kill" gnus-group-kill-group (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
583 ["Yank" gnus-group-yank-group gnus-list-of-killed-groups]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
584 ["Describe" gnus-group-describe-group (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
585 ["Fetch FAQ" gnus-group-fetch-faq (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
586 ;; Actually one should check, if any of the marked groups gives t for
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
587 ;; (gnus-check-backend-function 'request-expire-articles ...)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
588 ["Expire articles" gnus-group-expire-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
589 (or (and (gnus-group-group-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
590 (gnus-check-backend-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
591 'request-expire-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
592 (gnus-group-group-name))) gnus-group-marked)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
593 ["Set group level" gnus-group-set-current-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
594 (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
595 ["Select quick" gnus-group-quick-select-group (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
596 ["Customize" gnus-group-customize (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
597 ("Edit"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
598 ["Parameters" gnus-group-edit-group-parameters
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
599 (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
600 ["Select method" gnus-group-edit-group-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
601 (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
602 ["Info" gnus-group-edit-group (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
603 ["Local kill file" gnus-group-edit-local-kill (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
604 ["Global kill file" gnus-group-edit-global-kill t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
605 ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
606
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
607 (easy-menu-define
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
608 gnus-group-group-menu gnus-group-mode-map ""
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
609 '("Groups"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
610 ("Listing"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
611 ["List unread subscribed groups" gnus-group-list-groups t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
612 ["List (un)subscribed groups" gnus-group-list-all-groups t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
613 ["List killed groups" gnus-group-list-killed gnus-killed-list]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
614 ["List zombie groups" gnus-group-list-zombies gnus-zombie-list]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
615 ["List level..." gnus-group-list-level t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
616 ["Describe all groups" gnus-group-describe-all-groups t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
617 ["Group apropos..." gnus-group-apropos t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
618 ["Group and description apropos..." gnus-group-description-apropos t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
619 ["List groups matching..." gnus-group-list-matching t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
620 ["List all groups matching..." gnus-group-list-all-matching t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
621 ["List active file" gnus-group-list-active t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
622 ("Sort"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
623 ["Default sort" gnus-group-sort-groups t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
624 ["Sort by method" gnus-group-sort-groups-by-method t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
625 ["Sort by rank" gnus-group-sort-groups-by-rank t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
626 ["Sort by score" gnus-group-sort-groups-by-score t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
627 ["Sort by level" gnus-group-sort-groups-by-level t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
628 ["Sort by unread" gnus-group-sort-groups-by-unread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
629 ["Sort by name" gnus-group-sort-groups-by-alphabet t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
630 ("Sort process/prefixed"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
631 ["Default sort" gnus-group-sort-selected-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
632 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
633 ["Sort by method" gnus-group-sort-selected-groups-by-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
634 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
635 ["Sort by rank" gnus-group-sort-selected-groups-by-rank
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
636 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
637 ["Sort by score" gnus-group-sort-selected-groups-by-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
638 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
639 ["Sort by level" gnus-group-sort-selected-groups-by-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
640 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
641 ["Sort by unread" gnus-group-sort-selected-groups-by-unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
642 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
643 ["Sort by name" gnus-group-sort-selected-groups-by-alphabet
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
644 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
645 ("Mark"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
646 ["Mark group" gnus-group-mark-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
647 (and (gnus-group-group-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
648 (not (memq (gnus-group-group-name) gnus-group-marked)))]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
649 ["Unmark group" gnus-group-unmark-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
650 (and (gnus-group-group-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
651 (memq (gnus-group-group-name) gnus-group-marked))]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
652 ["Unmark all" gnus-group-unmark-all-groups gnus-group-marked]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
653 ["Mark regexp..." gnus-group-mark-regexp t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
654 ["Mark region" gnus-group-mark-region t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
655 ["Mark buffer" gnus-group-mark-buffer t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
656 ["Execute command" gnus-group-universal-argument
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
657 (or gnus-group-marked (gnus-group-group-name))])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
658 ("Subscribe"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
659 ["Subscribe to a group" gnus-group-unsubscribe-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
660 ["Kill all newsgroups in region" gnus-group-kill-region t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
661 ["Kill all zombie groups" gnus-group-kill-all-zombies
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
662 gnus-zombie-list]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
663 ["Kill all groups on level..." gnus-group-kill-level t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
664 ("Foreign groups"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
665 ["Make a foreign group" gnus-group-make-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
666 ["Add a directory group" gnus-group-make-directory-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
667 ["Add the help group" gnus-group-make-help-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
668 ["Add the archive group" gnus-group-make-archive-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
669 ["Make a doc group" gnus-group-make-doc-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
670 ["Make a web group" gnus-group-make-web-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
671 ["Make a kiboze group" gnus-group-make-kiboze-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
672 ["Make a virtual group" gnus-group-make-empty-virtual t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
673 ["Add a group to a virtual" gnus-group-add-to-virtual t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
674 ["Rename group" gnus-group-rename-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
675 (gnus-check-backend-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
676 'request-rename-group (gnus-group-group-name))]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
677 ["Delete group" gnus-group-delete-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
678 (gnus-check-backend-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
679 'request-delete-group (gnus-group-group-name))])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
680 ("Move"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
681 ["Next" gnus-group-next-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
682 ["Previous" gnus-group-prev-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
683 ["Next unread" gnus-group-next-unread-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
684 ["Previous unread" gnus-group-prev-unread-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
685 ["Next unread same level" gnus-group-next-unread-group-same-level t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
686 ["Previous unread same level"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
687 gnus-group-prev-unread-group-same-level t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
688 ["Jump to group" gnus-group-jump-to-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
689 ["First unread group" gnus-group-first-unread-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
690 ["Best unread group" gnus-group-best-unread-group t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
691 ["Delete bogus groups" gnus-group-check-bogus-groups t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
692 ["Find new newsgroups" gnus-find-new-newsgroups t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
693 ["Transpose" gnus-group-transpose-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
694 (gnus-group-group-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
695 ["Read a directory as a group..." gnus-group-enter-directory t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
696 ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
697
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
698 (easy-menu-define
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
699 gnus-group-misc-menu gnus-group-mode-map ""
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
700 '("Misc"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
701 ("SOUP"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
702 ["Pack replies" nnsoup-pack-replies (fboundp 'nnsoup-request-group)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
703 ["Send replies" gnus-soup-send-replies
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
704 (fboundp 'gnus-soup-pack-packet)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
705 ["Pack packet" gnus-soup-pack-packet (fboundp 'gnus-soup-pack-packet)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
706 ["Save areas" gnus-soup-save-areas (fboundp 'gnus-soup-pack-packet)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
707 ["Brew SOUP" gnus-soup-brew-soup (fboundp 'gnus-soup-pack-packet)])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
708 ["Send a bug report" gnus-bug t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
709 ["Send a mail" gnus-group-mail t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
710 ["Post an article..." gnus-group-post-news t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
711 ["Check for new news" gnus-group-get-new-news t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
712 ["Activate all groups" gnus-activate-all-groups t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
713 ["Restart Gnus" gnus-group-restart t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
714 ["Read init file" gnus-group-read-init-file t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
715 ["Browse foreign server" gnus-group-browse-foreign-server t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
716 ["Enter server buffer" gnus-group-enter-server-mode t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
717 ["Expire all expirable articles" gnus-group-expire-all-groups t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
718 ["Generate any kiboze groups" nnkiboze-generate-groups t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
719 ["Gnus version" gnus-version t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
720 ["Save .newsrc files" gnus-group-save-newsrc t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
721 ["Suspend Gnus" gnus-group-suspend t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
722 ["Clear dribble buffer" gnus-group-clear-dribble t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
723 ["Read manual" gnus-info-find-node t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
724 ["Flush score cache" gnus-score-flush-cache t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
725 ["Toggle topics" gnus-topic-mode t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
726 ["Exit from Gnus" gnus-group-exit t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
727 ["Exit without saving" gnus-group-quit t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
728 ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
729
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
730 (run-hooks 'gnus-group-menu-hook)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
731
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
732 (defun gnus-group-mode ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
733 "Major mode for reading news.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
734
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
735 All normal editing commands are switched off.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
736 \\<gnus-group-mode-map>
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
737 The group buffer lists (some of) the groups available. For instance,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
738 `\\[gnus-group-list-groups]' will list all subscribed groups with unread articles, while `\\[gnus-group-list-zombies]'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
739 lists all zombie groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
740
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
741 Groups that are displayed can be entered with `\\[gnus-group-read-group]'. To subscribe
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
742 to a group not displayed, type `\\[gnus-group-unsubscribe-group]'.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
743
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
744 For more in-depth information on this mode, read the manual (`\\[gnus-info-find-node]').
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
745
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
746 The following commands are available:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
747
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
748 \\{gnus-group-mode-map}"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
749 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
750 (when (gnus-visual-p 'group-menu 'menu)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
751 (gnus-group-make-menu-bar))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
752 (kill-all-local-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
753 (gnus-simplify-mode-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
754 (setq major-mode 'gnus-group-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
755 (setq mode-name "Group")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
756 (gnus-group-set-mode-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
757 (setq mode-line-process nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
758 (use-local-map gnus-group-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
759 (buffer-disable-undo (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
760 (setq truncate-lines t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
761 (setq buffer-read-only t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
762 (gnus-set-default-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
763 (gnus-update-format-specifications nil 'group 'group-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
764 (gnus-update-group-mark-positions)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
765 (make-local-hook 'post-command-hook)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
766 (gnus-add-hook 'post-command-hook 'gnus-clear-inboxes-moved nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
767 (when gnus-use-undo
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
768 (gnus-undo-mode 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
769 (run-hooks 'gnus-group-mode-hook))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
770
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
771 (defun gnus-update-group-mark-positions ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
772 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
773 (let ((gnus-process-mark 128)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
774 (gnus-group-marked '("dummy.group"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
775 (gnus-active-hashtb (make-vector 10 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
776 (gnus-set-active "dummy.group" '(0 . 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
777 (gnus-set-work-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
778 (gnus-group-insert-group-line "dummy.group" 0 nil 0 nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
779 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
780 (setq gnus-group-mark-positions
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
781 (list (cons 'process (and (search-forward "\200" nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
782 (- (point) 2))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
783
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
784 (defun gnus-clear-inboxes-moved ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
785 (setq nnmail-moved-inboxes nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
786
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
787 (defun gnus-mouse-pick-group (e)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
788 "Enter the group under the mouse pointer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
789 (interactive "e")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
790 (mouse-set-point e)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
791 (gnus-group-read-group nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
792
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
793 ;; Look at LEVEL and find out what the level is really supposed to be.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
794 ;; If LEVEL is non-nil, LEVEL will be returned, if not, what happens
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
795 ;; will depend on whether `gnus-group-use-permanent-levels' is used.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
796 (defun gnus-group-default-level (&optional level number-or-nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
797 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
798 (gnus-group-use-permanent-levels
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
799 (or (setq gnus-group-use-permanent-levels
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
800 (or level (if (numberp gnus-group-use-permanent-levels)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
801 gnus-group-use-permanent-levels
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
802 (or gnus-group-default-list-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
803 gnus-level-subscribed))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
804 gnus-group-default-list-level gnus-level-subscribed))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
805 (number-or-nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
806 level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
807 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
808 (or level gnus-group-default-list-level gnus-level-subscribed))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
809
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
810 (defun gnus-group-setup-buffer ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
811 (switch-to-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
812 (unless (eq major-mode 'gnus-group-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
813 (gnus-add-current-to-buffer-list)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
814 (gnus-group-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
815 (when gnus-carpal
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
816 (gnus-carpal-setup-buffer 'group))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
817
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
818 (defun gnus-group-list-groups (&optional level unread lowest)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
819 "List newsgroups with level LEVEL or lower that have unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
820 Default is all subscribed groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
821 If argument UNREAD is non-nil, groups with no unread articles are also
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
822 listed."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
823 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
824 (list (if current-prefix-arg
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
825 (prefix-numeric-value current-prefix-arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
826 (or
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
827 (gnus-group-default-level nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
828 gnus-group-default-list-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
829 gnus-level-subscribed))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
830 ;; Just do this here, for no particular good reason.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
831 (gnus-clear-inboxes-moved)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
832 (unless level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
833 (setq level (car gnus-group-list-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
834 unread (cdr gnus-group-list-mode)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
835 (setq level (gnus-group-default-level level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
836 (gnus-group-setup-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
837 (gnus-update-format-specifications nil 'group 'group-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
838 (let ((case-fold-search nil)
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
839 (props (text-properties-at (gnus-point-at-bol)))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
840 (empty (= (point-min) (point-max)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
841 (group (gnus-group-group-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
842 number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
843 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
844 (setq number (funcall gnus-group-prepare-function level unread lowest))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
845 (when (or (and (numberp number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
846 (zerop number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
847 (zerop (buffer-size)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
848 ;; No groups in the buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
849 (gnus-message 5 gnus-no-groups-message))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
850 ;; We have some groups displayed.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
851 (goto-char (point-max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
852 (when (or (not gnus-group-goto-next-group-function)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
853 (not (funcall gnus-group-goto-next-group-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
854 group props)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
855 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
856 (empty
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
857 (goto-char (point-min)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
858 ((not group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
859 ;; Go to the first group with unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
860 (gnus-group-search-forward t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
861 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
862 ;; Find the right group to put point on. If the current group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
863 ;; has disappeared in the new listing, try to find the next
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
864 ;; one. If no next one can be found, just leave point at the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
865 ;; first newsgroup in the buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
866 (when (not (gnus-goto-char
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
867 (text-property-any
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
868 (point-min) (point-max)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
869 'gnus-group (gnus-intern-safe
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
870 group gnus-active-hashtb))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
871 (let ((newsrc (cdddr (gnus-gethash group gnus-newsrc-hashtb))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
872 (while (and newsrc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
873 (not (gnus-goto-char
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
874 (text-property-any
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
875 (point-min) (point-max) 'gnus-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
876 (gnus-intern-safe
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
877 (caar newsrc) gnus-active-hashtb)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
878 (setq newsrc (cdr newsrc)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
879 (unless newsrc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
880 (goto-char (point-max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
881 (forward-line -1)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
882 ;; Adjust cursor point.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
883 (gnus-group-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
884
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
885 (defun gnus-group-list-level (level &optional all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
886 "List groups on LEVEL.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
887 If ALL (the prefix), also list groups that have no unread articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
888 (interactive "nList groups on level: \nP")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
889 (gnus-group-list-groups level all level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
890
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
891 (defun gnus-group-prepare-flat (level &optional all lowest regexp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
892 "List all newsgroups with unread articles of level LEVEL or lower.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
893 If ALL is non-nil, list groups that have no unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
894 If LOWEST is non-nil, list all newsgroups of level LOWEST or higher.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
895 If REGEXP, only list groups matching REGEXP."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
896 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
897 (let ((buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
898 (newsrc (cdr gnus-newsrc-alist))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
899 (lowest (or lowest 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
900 info clevel unread group params)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
901 (erase-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
902 (when (< lowest gnus-level-zombie)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
903 ;; List living groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
904 (while newsrc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
905 (setq info (car newsrc)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
906 group (gnus-info-group info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
907 params (gnus-info-params info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
908 newsrc (cdr newsrc)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
909 unread (car (gnus-gethash group gnus-newsrc-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
910 (and unread ; This group might be bogus
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
911 (or (not regexp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
912 (string-match regexp group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
913 (<= (setq clevel (gnus-info-level info)) level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
914 (>= clevel lowest)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
915 (or all ; We list all groups?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
916 (if (eq unread t) ; Unactivated?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
917 gnus-group-list-inactive-groups ; We list unactivated
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
918 (> unread 0)) ; We list groups with unread articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
919 (and gnus-list-groups-with-ticked-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
920 (cdr (assq 'tick (gnus-info-marks info))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
921 ; And groups with tickeds
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
922 ;; Check for permanent visibility.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
923 (and gnus-permanently-visible-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
924 (string-match gnus-permanently-visible-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
925 group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
926 (memq 'visible params)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
927 (cdr (assq 'visible params)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
928 (gnus-group-insert-group-line
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
929 group (gnus-info-level info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
930 (gnus-info-marks info) unread (gnus-info-method info)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
931
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
932 ;; List dead groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
933 (and (>= level gnus-level-zombie) (<= lowest gnus-level-zombie)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
934 (gnus-group-prepare-flat-list-dead
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
935 (setq gnus-zombie-list (sort gnus-zombie-list 'string<))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
936 gnus-level-zombie ?Z
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
937 regexp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
938 (and (>= level gnus-level-killed) (<= lowest gnus-level-killed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
939 (gnus-group-prepare-flat-list-dead
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
940 (setq gnus-killed-list (sort gnus-killed-list 'string<))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
941 gnus-level-killed ?K regexp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
942
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
943 (gnus-group-set-mode-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
944 (setq gnus-group-list-mode (cons level all))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
945 (run-hooks 'gnus-group-prepare-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
946 t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
947
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
948 (defun gnus-group-prepare-flat-list-dead (groups level mark regexp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
949 ;; List zombies and killed lists somewhat faster, which was
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
950 ;; suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>. It does
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
951 ;; this by ignoring the group format specification altogether.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
952 (let (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
953 (if regexp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
954 ;; This loop is used when listing groups that match some
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
955 ;; regexp.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
956 (while groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
957 (setq group (pop groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
958 (when (string-match regexp group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
959 (gnus-add-text-properties
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
960 (point) (prog1 (1+ (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
961 (insert " " mark " *: " group "\n"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
962 (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
963 'gnus-unread t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
964 'gnus-level level))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
965 ;; This loop is used when listing all groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
966 (while groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
967 (gnus-add-text-properties
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
968 (point) (prog1 (1+ (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
969 (insert " " mark " *: "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
970 (setq group (pop groups)) "\n"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
971 (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
972 'gnus-unread t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
973 'gnus-level level))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
974
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
975 (defun gnus-group-update-group-line ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
976 "Update the current line in the group buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
977 (let* ((buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
978 (group (gnus-group-group-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
979 (entry (and group (gnus-gethash group gnus-newsrc-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
980 gnus-group-indentation)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
981 (when group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
982 (and entry
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
983 (not (gnus-ephemeral-group-p group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
984 (gnus-dribble-enter
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
985 (concat "(gnus-group-set-info '"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
986 (gnus-prin1-to-string (nth 2 entry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
987 ")")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
988 (setq gnus-group-indentation (gnus-group-group-indentation))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
989 (gnus-delete-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
990 (gnus-group-insert-group-line-info group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
991 (forward-line -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
992 (gnus-group-position-point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
993
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
994 (defun gnus-group-insert-group-line-info (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
995 "Insert GROUP on the current line."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
996 (let ((entry (gnus-gethash group gnus-newsrc-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
997 (gnus-group-indentation (gnus-group-group-indentation))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
998 active info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
999 (if entry
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1000 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1001 ;; (Un)subscribed group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1002 (setq info (nth 2 entry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1003 (gnus-group-insert-group-line
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1004 group (gnus-info-level info) (gnus-info-marks info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1005 (or (car entry) t) (gnus-info-method info)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1006 ;; This group is dead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1007 (gnus-group-insert-group-line
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1008 group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1009 (if (member group gnus-zombie-list) gnus-level-zombie gnus-level-killed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1010 nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1011 (if (setq active (gnus-active group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1012 (if (zerop (cdr active))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1013 0
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1014 (- (1+ (cdr active)) (car active)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1015 nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1016 nil))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1017
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1018 (defun gnus-group-insert-group-line (gnus-tmp-group gnus-tmp-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1019 gnus-tmp-marked number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1020 gnus-tmp-method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1021 "Insert a group line in the group buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1022 (let* ((gnus-tmp-active (gnus-active gnus-tmp-group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1023 (gnus-tmp-number-total
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1024 (if gnus-tmp-active
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1025 (1+ (- (cdr gnus-tmp-active) (car gnus-tmp-active)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1026 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1027 (gnus-tmp-number-of-unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1028 (if (numberp number) (int-to-string (max 0 number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1029 "*"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1030 (gnus-tmp-number-of-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1031 (if (numberp number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1032 (int-to-string (max 0 (- gnus-tmp-number-total number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1033 "*"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1034 (gnus-tmp-subscribed
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1035 (cond ((<= gnus-tmp-level gnus-level-subscribed) ? )
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1036 ((<= gnus-tmp-level gnus-level-unsubscribed) ?U)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1037 ((= gnus-tmp-level gnus-level-zombie) ?Z)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1038 (t ?K)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1039 (gnus-tmp-qualified-group (gnus-group-real-name gnus-tmp-group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1040 (gnus-tmp-newsgroup-description
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1041 (if gnus-description-hashtb
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1042 (or (gnus-gethash gnus-tmp-group gnus-description-hashtb) "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1043 ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1044 (gnus-tmp-moderated
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1045 (if (and gnus-moderated-hashtb
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1046 (gnus-gethash gnus-tmp-group gnus-moderated-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1047 ?m ? ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1048 (gnus-tmp-moderated-string
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1049 (if (eq gnus-tmp-moderated ?m) "(m)" ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1050 (gnus-tmp-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1051 (gnus-server-get-method gnus-tmp-group gnus-tmp-method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1052 (gnus-tmp-news-server (or (cadr gnus-tmp-method) ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1053 (gnus-tmp-news-method (or (car gnus-tmp-method) ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1054 (gnus-tmp-news-method-string
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1055 (if gnus-tmp-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1056 (format "(%s:%s)" (car gnus-tmp-method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1057 (cadr gnus-tmp-method)) ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1058 (gnus-tmp-marked-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1059 (if (and (numberp number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1060 (zerop number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1061 (cdr (assq 'tick gnus-tmp-marked)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1062 ?* ? ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1063 (gnus-tmp-process-marked
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1064 (if (member gnus-tmp-group gnus-group-marked)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1065 gnus-process-mark ? ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1066 (gnus-tmp-grouplens
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1067 (or (and gnus-use-grouplens
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1068 (bbb-grouplens-group-p gnus-tmp-group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1069 ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1070 (buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1071 header gnus-tmp-header) ; passed as parameter to user-funcs.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1072 (beginning-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1073 (gnus-add-text-properties
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1074 (point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1075 (prog1 (1+ (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1076 ;; Insert the text.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1077 (eval gnus-group-line-format-spec))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1078 `(gnus-group ,(gnus-intern-safe gnus-tmp-group gnus-active-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1079 gnus-unread ,(if (numberp number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1080 (string-to-int gnus-tmp-number-of-unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1081 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1082 gnus-marked ,gnus-tmp-marked-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1083 gnus-indentation ,gnus-group-indentation
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1084 gnus-level ,gnus-tmp-level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1085 (when (inline (gnus-visual-p 'group-highlight 'highlight))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1086 (forward-line -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1087 (run-hooks 'gnus-group-update-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1088 (forward-line))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1089 ;; Allow XEmacs to remove front-sticky text properties.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1090 (gnus-group-remove-excess-properties)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1091
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1092 (defun gnus-group-highlight-line ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1093 "Highlight the current line according to `gnus-group-highlight'."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1094 (let* ((list gnus-group-highlight)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1095 (p (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1096 (end (progn (end-of-line) (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1097 ;; now find out where the line starts and leave point there.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1098 (beg (progn (beginning-of-line) (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1099 (group (gnus-group-group-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1100 (entry (gnus-group-entry group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1101 (unread (if (numberp (car entry)) (car entry) 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1102 (active (gnus-active group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1103 (total (if active (1+ (- (cdr active) (car active))) 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1104 (info (nth 2 entry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1105 (method (gnus-server-get-method group (gnus-info-method info)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1106 (marked (gnus-info-marks info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1107 (mailp (memq 'mail (assoc (symbol-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1108 (car (or method gnus-select-method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1109 gnus-valid-select-methods)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1110 (level (or (gnus-info-level info) 9))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1111 (score (or (gnus-info-score info) 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1112 (ticked (gnus-range-length (cdr (assq 'tick marked))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1113 (group-age (gnus-group-timestamp-delta group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1114 (inhibit-read-only t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1115 ;; Eval the cars of the lists until we find a match.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1116 (while (and list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1117 (not (eval (caar list))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1118 (setq list (cdr list)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1119 (let ((face (cdar list)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1120 (unless (eq face (get-text-property beg 'face))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1121 (gnus-put-text-property
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1122 beg end 'face
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1123 (setq face (if (boundp face) (symbol-value face) face)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1124 (gnus-extent-start-open beg)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1125 (goto-char p)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1126
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1127 (defun gnus-group-update-group (group &optional visible-only)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1128 "Update all lines where GROUP appear.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1129 If VISIBLE-ONLY is non-nil, the group won't be displayed if it isn't
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1130 already."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1131 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1132 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1133 ;; The buffer may be narrowed.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1134 (save-restriction
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1135 (widen)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1136 (let ((ident (gnus-intern-safe group gnus-active-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1137 (loc (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1138 found buffer-read-only)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1139 ;; Enter the current status into the dribble buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1140 (let ((entry (gnus-gethash group gnus-newsrc-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1141 (when (and entry (not (gnus-ephemeral-group-p group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1142 (gnus-dribble-enter
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1143 (concat "(gnus-group-set-info '"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1144 (gnus-prin1-to-string (nth 2 entry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1145 ")"))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1146 ;; Find all group instances. If topics are in use, each group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1147 ;; may be listed in more than once.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1148 (while (setq loc (text-property-any
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1149 loc (point-max) 'gnus-group ident))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1150 (setq found t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1151 (goto-char loc)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1152 (let ((gnus-group-indentation (gnus-group-group-indentation)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1153 (gnus-delete-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1154 (gnus-group-insert-group-line-info group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1155 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1156 (forward-line -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1157 (run-hooks 'gnus-group-update-group-hook)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1158 (setq loc (1+ loc)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1159 (unless (or found visible-only)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1160 ;; No such line in the buffer, find out where it's supposed to
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1161 ;; go, and insert it there (or at the end of the buffer).
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1162 (if gnus-goto-missing-group-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1163 (funcall gnus-goto-missing-group-function group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1164 (let ((entry (cddr (gnus-gethash group gnus-newsrc-hashtb))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1165 (while (and entry (car entry)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1166 (not
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1167 (gnus-goto-char
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1168 (text-property-any
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1169 (point-min) (point-max)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1170 'gnus-group (gnus-intern-safe
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1171 (caar entry) gnus-active-hashtb)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1172 (setq entry (cdr entry)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1173 (or entry (goto-char (point-max)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1174 ;; Finally insert the line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1175 (let ((gnus-group-indentation (gnus-group-group-indentation)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1176 (gnus-group-insert-group-line-info group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1177 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1178 (forward-line -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1179 (run-hooks 'gnus-group-update-group-hook))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1180 (when gnus-group-update-group-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1181 (funcall gnus-group-update-group-function group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1182 (gnus-group-set-mode-line)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1183
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1184 (defun gnus-group-set-mode-line ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1185 "Update the mode line in the group buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1186 (when (memq 'group gnus-updated-mode-lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1187 ;; Yes, we want to keep this mode line updated.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1188 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1189 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1190 (let* ((gformat (or gnus-group-mode-line-format-spec
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1191 (setq gnus-group-mode-line-format-spec
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1192 (gnus-parse-format
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1193 gnus-group-mode-line-format
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1194 gnus-group-mode-line-format-alist))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1195 (gnus-tmp-news-server (cadr gnus-select-method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1196 (gnus-tmp-news-method (car gnus-select-method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1197 (gnus-tmp-colon (if (equal gnus-tmp-news-server "") "" ":"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1198 (max-len 60)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1199 gnus-tmp-header ;Dummy binding for user-defined formats
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1200 ;; Get the resulting string.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1201 (modified
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1202 (and gnus-dribble-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1203 (buffer-name gnus-dribble-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1204 (buffer-modified-p gnus-dribble-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1205 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1206 (set-buffer gnus-dribble-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1207 (not (zerop (buffer-size))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1208 (mode-string (eval gformat)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1209 ;; Say whether the dribble buffer has been modified.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1210 (setq mode-line-modified
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1211 (if modified "---*- " "----- "))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1212 ;; If the line is too long, we chop it off.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1213 (when (> (length mode-string) max-len)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1214 (setq mode-string (substring mode-string 0 (- max-len 4))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1215 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1216 (setq mode-line-buffer-identification
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1217 (gnus-mode-line-buffer-identification
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1218 (list mode-string)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1219 (set-buffer-modified-p modified))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1220
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1221 (defun gnus-group-group-name ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1222 "Get the name of the newsgroup on the current line."
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
1223 (let ((group (get-text-property (gnus-point-at-bol) 'gnus-group)))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1224 (and group (symbol-name group))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1225
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1226 (defun gnus-group-group-level ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1227 "Get the level of the newsgroup on the current line."
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
1228 (get-text-property (gnus-point-at-bol) 'gnus-level))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1229
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1230 (defun gnus-group-group-indentation ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1231 "Get the indentation of the newsgroup on the current line."
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
1232 (or (get-text-property (gnus-point-at-bol) 'gnus-indentation)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1233 (and gnus-group-indentation-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1234 (funcall gnus-group-indentation-function))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1235 ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1236
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1237 (defun gnus-group-group-unread ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1238 "Get the number of unread articles of the newsgroup on the current line."
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
1239 (get-text-property (gnus-point-at-bol) 'gnus-unread))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1240
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1241 (defun gnus-group-new-mail (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1242 (if (nnmail-new-mail-p (gnus-group-real-name group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1243 gnus-new-mail-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1244 ? ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1245
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1246 (defun gnus-group-level (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1247 "Return the estimated level of GROUP."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1248 (or (gnus-info-level (gnus-get-info group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1249 (and (member group gnus-zombie-list) 8)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1250 9))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1251
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1252 (defun gnus-group-search-forward (&optional backward all level first-too)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1253 "Find the next newsgroup with unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1254 If BACKWARD is non-nil, find the previous newsgroup instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1255 If ALL is non-nil, just find any newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1256 If LEVEL is non-nil, find group with level LEVEL, or higher if no such
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1257 group exists.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1258 If FIRST-TOO, the current line is also eligible as a target."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1259 (let ((way (if backward -1 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1260 (low gnus-level-killed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1261 (beg (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1262 pos found lev)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1263 (if (and backward (progn (beginning-of-line)) (bobp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1264 nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1265 (unless first-too
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1266 (forward-line way))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1267 (while (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1268 (not (eobp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1269 (not (setq
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1270 found
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1271 (and (or all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1272 (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1273 (let ((unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1274 (get-text-property (point) 'gnus-unread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1275 (and (numberp unread) (> unread 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1276 (setq lev (get-text-property (point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1277 'gnus-level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1278 (<= lev gnus-level-subscribed)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1279 (or (not level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1280 (and (setq lev (get-text-property (point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1281 'gnus-level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1282 (or (= lev level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1283 (and (< lev low)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1284 (< level lev)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1285 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1286 (setq low lev)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1287 (setq pos (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1288 nil))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1289 (zerop (forward-line way)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1290 (if found
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1291 (progn (gnus-group-position-point) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1292 (goto-char (or pos beg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1293 (and pos t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1294
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1295 ;;; Gnus group mode commands
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1296
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1297 ;; Group marking.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1298
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1299 (defun gnus-group-mark-group (n &optional unmark no-advance)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1300 "Mark the current group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1301 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1302 (let ((buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1303 group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1304 (while (and (> n 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1305 (not (eobp)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1306 (when (setq group (gnus-group-group-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1307 ;; Go to the mark position.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1308 (beginning-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1309 (forward-char (or (cdr (assq 'process gnus-group-mark-positions)) 2))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1310 (subst-char-in-region
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1311 (point) (1+ (point)) (following-char)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1312 (if unmark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1313 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1314 (setq gnus-group-marked (delete group gnus-group-marked))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1315 ? )
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1316 (setq gnus-group-marked
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1317 (cons group (delete group gnus-group-marked)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1318 gnus-process-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1319 (unless no-advance
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1320 (gnus-group-next-group 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1321 (decf n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1322 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1323 n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1324
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1325 (defun gnus-group-unmark-group (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1326 "Remove the mark from the current group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1327 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1328 (gnus-group-mark-group n 'unmark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1329 (gnus-group-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1330
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1331 (defun gnus-group-unmark-all-groups ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1332 "Unmark all groups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1333 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1334 (let ((groups gnus-group-marked))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1335 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1336 (while groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1337 (gnus-group-remove-mark (pop groups)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1338 (gnus-group-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1339
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1340 (defun gnus-group-mark-region (unmark beg end)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1341 "Mark all groups between point and mark.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1342 If UNMARK, remove the mark instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1343 (interactive "P\nr")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1344 (let ((num (count-lines beg end)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1345 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1346 (goto-char beg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1347 (- num (gnus-group-mark-group num unmark)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1348
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1349 (defun gnus-group-mark-buffer (&optional unmark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1350 "Mark all groups in the buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1351 If UNMARK, remove the mark instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1352 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1353 (gnus-group-mark-region unmark (point-min) (point-max)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1354
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1355 (defun gnus-group-mark-regexp (regexp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1356 "Mark all groups that match some regexp."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1357 (interactive "sMark (regexp): ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1358 (let ((alist (cdr gnus-newsrc-alist))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1359 group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1360 (while alist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1361 (when (string-match regexp (setq group (gnus-info-group (pop alist))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1362 (gnus-group-set-mark group))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1363 (gnus-group-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1364
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1365 (defun gnus-group-remove-mark (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1366 "Remove the process mark from GROUP and move point there.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1367 Return nil if the group isn't displayed."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1368 (if (gnus-group-goto-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1369 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1370 (gnus-group-mark-group 1 'unmark t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1371 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1372 (setq gnus-group-marked
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1373 (delete group gnus-group-marked))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1374 nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1375
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1376 (defun gnus-group-set-mark (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1377 "Set the process mark on GROUP."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1378 (if (gnus-group-goto-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1379 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1380 (gnus-group-mark-group 1 nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1381 (setq gnus-group-marked (cons group (delete group gnus-group-marked)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1382
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1383 (defun gnus-group-universal-argument (arg &optional groups func)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1384 "Perform any command on all groups according to the process/prefix convention."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1385 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1386 (if (eq (setq func (or func
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1387 (key-binding
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1388 (read-key-sequence
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1389 (substitute-command-keys
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1390 "\\<gnus-group-mode-map>\\[gnus-group-universal-argument]")))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1391 'undefined)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1392 (gnus-error 1 "Undefined key")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1393 (gnus-group-iterate arg
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1394 (lambda (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1395 (command-execute func))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1396 (gnus-group-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1397
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1398 (defun gnus-group-process-prefix (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1399 "Return a list of groups to work on.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1400 Take into consideration N (the prefix) and the list of marked groups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1401 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1402 (n
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1403 (setq n (prefix-numeric-value n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1404 ;; There is a prefix, so we return a list of the N next
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1405 ;; groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1406 (let ((way (if (< n 0) -1 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1407 (n (abs n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1408 group groups)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1409 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1410 (while (and (> n 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1411 (setq group (gnus-group-group-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1412 (push group groups)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1413 (setq n (1- n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1414 (gnus-group-next-group way)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1415 (nreverse groups)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1416 ((and (boundp 'transient-mark-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1417 transient-mark-mode
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1418 (boundp 'mark-active)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1419 mark-active)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1420 ;; Work on the region between point and mark.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1421 (let ((max (max (point) (mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1422 groups)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1423 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1424 (goto-char (min (point) (mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1425 (while
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1426 (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1427 (push (gnus-group-group-name) groups)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1428 (zerop (gnus-group-next-group 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1429 (< (point) max)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1430 (nreverse groups))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1431 (gnus-group-marked
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1432 ;; No prefix, but a list of marked articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1433 (reverse gnus-group-marked))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1434 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1435 ;; Neither marked articles or a prefix, so we return the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1436 ;; current group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1437 (let ((group (gnus-group-group-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1438 (and group (list group))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1439
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1440 (defun gnus-group-iterate (arg function)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1441 "Iterate FUNCTION over all process/prefixed groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1442 FUNCTION will be called with the group name as the paremeter
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1443 and with point over the group in question."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1444 (let ((groups (gnus-group-process-prefix arg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1445 group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1446 (while (setq group (pop groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1447 (gnus-group-remove-mark group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1448 (funcall function group))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1449
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1450 (put 'gnus-group-iterate 'lisp-indent-function 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1451
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1452 ;; Selecting groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1453
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1454 (defun gnus-group-read-group (&optional all no-article group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1455 "Read news in this newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1456 If the prefix argument ALL is non-nil, already read articles become
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1457 readable. IF ALL is a number, fetch this number of articles. If the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1458 optional argument NO-ARTICLE is non-nil, no article will be
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1459 auto-selected upon group entry. If GROUP is non-nil, fetch that
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1460 group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1461 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1462 (let ((no-display (eq all 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1463 (group (or group (gnus-group-group-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1464 number active marked entry)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1465 (when (eq all 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1466 (setq all nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1467 (unless group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1468 (error "No group on current line"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1469 (setq marked (gnus-info-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1470 (nth 2 (setq entry (gnus-gethash
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1471 group gnus-newsrc-hashtb)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1472 ;; This group might be a dead group. In that case we have to get
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1473 ;; the number of unread articles from `gnus-active-hashtb'.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1474 (setq number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1475 (cond ((numberp all) all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1476 (entry (car entry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1477 ((setq active (gnus-active group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1478 (- (1+ (cdr active)) (car active)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1479 (gnus-summary-read-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1480 group (or all (and (numberp number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1481 (zerop (+ number (gnus-range-length
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1482 (cdr (assq 'tick marked)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1483 (gnus-range-length
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1484 (cdr (assq 'dormant marked)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1485 no-article nil no-display)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1486
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1487 (defun gnus-group-select-group (&optional all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1488 "Select this newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1489 No article is selected automatically.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1490 If ALL is non-nil, already read articles become readable.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1491 If ALL is a number, fetch this number of articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1492 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1493 (gnus-group-read-group all t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1494
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1495 (defun gnus-group-quick-select-group (&optional all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1496 "Select the current group \"quickly\".
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1497 This means that no highlighting or scoring will be performed.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1498 If ALL (the prefix argument) is 0, don't even generate the summary
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1499 buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1500 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1501 (require 'gnus-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1502 (let (gnus-visual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1503 gnus-score-find-score-files-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1504 gnus-apply-kill-hook
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1505 gnus-summary-expunge-below)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1506 (gnus-group-read-group all t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1507
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1508 (defun gnus-group-visible-select-group (&optional all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1509 "Select the current group without hiding any articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1510 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1511 (let ((gnus-inhibit-limiting t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1512 (gnus-group-read-group all t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1513
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1514 (defun gnus-group-select-group-ephemerally ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1515 "Select the current group without doing any processing whatsoever.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1516 You will actually be entered into a group that's a copy of
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1517 the current group; no changes you make while in this group will
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1518 be permanent."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1519 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1520 (require 'gnus-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1521 (let* (gnus-visual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1522 gnus-score-find-score-files-function gnus-apply-kill-hook
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1523 gnus-summary-expunge-below gnus-show-threads gnus-suppress-duplicates
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1524 gnus-summary-mode-hook gnus-select-group-hook
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1525 (group (gnus-group-group-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1526 (method (gnus-find-method-for-group group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1527 (setq method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1528 `(,(car method) ,(concat (cadr method) "-ephemeral")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1529 (,(intern (format "%s-address" (car method))) ,(cadr method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1530 ,@(cddr method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1531 (gnus-group-read-ephemeral-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1532 (gnus-group-prefixed-name group method) method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1533
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1534 ;;;###autoload
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1535 (defun gnus-fetch-group (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1536 "Start Gnus if necessary and enter GROUP.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1537 Returns whether the fetching was successful or not."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1538 (interactive "sGroup name: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1539 (unless (get-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1540 (gnus))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1541 (gnus-group-read-group nil nil group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1542
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1543 ;; Enter a group that is not in the group buffer. Non-nil is returned
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1544 ;; if selection was successful.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1545 (defun gnus-group-read-ephemeral-group (group method &optional activate
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1546 quit-config request-only)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1547 "Read GROUP from METHOD as an ephemeral group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1548 If ACTIVATE, request the group first.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1549 If QUIT-CONFIG, use that window configuration when exiting from the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1550 ephemeral group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1551 If REQUEST-ONLY, don't actually read the group; just request it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1552
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1553 Return the name of the group is selection was successful."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1554 (let ((group (if (gnus-group-foreign-p group) group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1555 (gnus-group-prefixed-name group method))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1556 (gnus-sethash
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1557 group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1558 `(-1 nil (,group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1559 ,gnus-level-default-subscribed nil nil ,method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1560 ((quit-config .
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1561 ,(if quit-config quit-config
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1562 (cons gnus-summary-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1563 gnus-current-window-configuration))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1564 gnus-newsrc-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1565 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1566 (unless (gnus-check-server method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1567 (error "Unable to contact server: %s" (gnus-status-message method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1568 (when activate
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1569 (gnus-activate-group group 'scan)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1570 (unless (gnus-request-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1571 (error "Couldn't request group: %s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1572 (nnheader-get-report (car method)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1573 (if request-only
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1574 group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1575 (condition-case ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1576 (when (gnus-group-read-group t t group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1577 group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1578 ;;(error nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1579 (quit nil)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1580
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1581 (defun gnus-group-jump-to-group (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1582 "Jump to newsgroup GROUP."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1583 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1584 (list (completing-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1585 "Group: " gnus-active-hashtb nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1586 (gnus-read-active-file-p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1587 nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1588 'gnus-group-history)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1589
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1590 (when (equal group "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1591 (error "Empty group name"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1592
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1593 (unless (gnus-ephemeral-group-p group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1594 ;; Either go to the line in the group buffer...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1595 (unless (gnus-group-goto-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1596 ;; ... or insert the line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1597 (gnus-group-update-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1598 (gnus-group-goto-group group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1599 ;; Adjust cursor point.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1600 (gnus-group-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1601
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1602 (defun gnus-group-goto-group (group &optional far)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1603 "Goto to newsgroup GROUP.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1604 If FAR, it is likely that the group is not on the current line."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1605 (when group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1606 (if far
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1607 (gnus-goto-char
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1608 (text-property-any
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1609 (point-min) (point-max)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1610 'gnus-group (gnus-intern-safe group gnus-active-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1611 (beginning-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1612 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1613 ;; It's quite likely that we are on the right line, so
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1614 ;; we check the current line first.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1615 ((eq (get-text-property (point) 'gnus-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1616 (gnus-intern-safe group gnus-active-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1617 (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1618 ;; Previous and next line are also likely, so we check them as well.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1619 ((save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1620 (forward-line -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1621 (eq (get-text-property (point) 'gnus-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1622 (gnus-intern-safe group gnus-active-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1623 (forward-line -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1624 (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1625 ((save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1626 (forward-line 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1627 (eq (get-text-property (point) 'gnus-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1628 (gnus-intern-safe group gnus-active-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1629 (forward-line 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1630 (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1631 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1632 ;; Search through the entire buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1633 (gnus-goto-char
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1634 (text-property-any
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1635 (point-min) (point-max)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1636 'gnus-group (gnus-intern-safe group gnus-active-hashtb))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1637
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1638 (defun gnus-group-next-group (n &optional silent)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1639 "Go to next N'th newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1640 If N is negative, search backward instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1641 Returns the difference between N and the number of skips actually
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1642 done."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1643 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1644 (gnus-group-next-unread-group n t nil silent))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1645
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1646 (defun gnus-group-next-unread-group (n &optional all level silent)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1647 "Go to next N'th unread newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1648 If N is negative, search backward instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1649 If ALL is non-nil, choose any newsgroup, unread or not.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1650 If LEVEL is non-nil, choose the next group with level LEVEL, or, if no
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1651 such group can be found, the next group with a level higher than
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1652 LEVEL.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1653 Returns the difference between N and the number of skips actually
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1654 made."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1655 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1656 (let ((backward (< n 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1657 (n (abs n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1658 (while (and (> n 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1659 (gnus-group-search-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1660 backward (or (not gnus-group-goto-unread) all) level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1661 (setq n (1- n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1662 (when (and (/= 0 n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1663 (not silent))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1664 (gnus-message 7 "No more%s newsgroups%s" (if all "" " unread")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1665 (if level " on this level or higher" "")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1666 n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1667
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1668 (defun gnus-group-prev-group (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1669 "Go to previous N'th newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1670 Returns the difference between N and the number of skips actually
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1671 done."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1672 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1673 (gnus-group-next-unread-group (- n) t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1674
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1675 (defun gnus-group-prev-unread-group (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1676 "Go to previous N'th unread newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1677 Returns the difference between N and the number of skips actually
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1678 done."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1679 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1680 (gnus-group-next-unread-group (- n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1681
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1682 (defun gnus-group-next-unread-group-same-level (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1683 "Go to next N'th unread newsgroup on the same level.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1684 If N is negative, search backward instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1685 Returns the difference between N and the number of skips actually
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1686 done."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1687 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1688 (gnus-group-next-unread-group n t (gnus-group-group-level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1689 (gnus-group-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1690
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1691 (defun gnus-group-prev-unread-group-same-level (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1692 "Go to next N'th unread newsgroup on the same level.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1693 Returns the difference between N and the number of skips actually
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1694 done."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1695 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1696 (gnus-group-next-unread-group (- n) t (gnus-group-group-level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1697 (gnus-group-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1698
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1699 (defun gnus-group-best-unread-group (&optional exclude-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1700 "Go to the group with the highest level.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1701 If EXCLUDE-GROUP, do not go to that group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1702 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1703 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1704 (let ((best 100000)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1705 unread best-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1706 (while (not (eobp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1707 (setq unread (get-text-property (point) 'gnus-unread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1708 (when (and (numberp unread) (> unread 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1709 (when (and (get-text-property (point) 'gnus-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1710 (< (get-text-property (point) 'gnus-level) best)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1711 (or (not exclude-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1712 (not (equal exclude-group (gnus-group-group-name)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1713 (setq best (get-text-property (point) 'gnus-level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1714 (setq best-point (point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1715 (forward-line 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1716 (when best-point
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1717 (goto-char best-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1718 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1719 (and best-point (gnus-group-group-name))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1720
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1721 (defun gnus-group-first-unread-group ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1722 "Go to the first group with unread articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1723 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1724 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1725 (let ((opoint (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1726 unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1727 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1728 (if (or (eq (setq unread (gnus-group-group-unread)) t) ; Not active.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1729 (and (numberp unread) ; Not a topic.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1730 (not (zerop unread))) ; Has unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1731 (zerop (gnus-group-next-unread-group 1))) ; Next unread group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1732 (point) ; Success.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1733 (goto-char opoint)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1734 nil)) ; Not success.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1735 (gnus-group-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1736
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1737 (defun gnus-group-enter-server-mode ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1738 "Jump to the server buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1739 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1740 (gnus-enter-server-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1741
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1742 (defun gnus-group-make-group (name &optional method address args)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1743 "Add a new newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1744 The user will be prompted for a NAME, for a select METHOD, and an
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1745 ADDRESS."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1746 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1747 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1748 (gnus-read-group "Group name: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1749 (gnus-read-method "From method: ")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1750
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1751 (let* ((meth (when (and method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1752 (not (gnus-server-equal method gnus-select-method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1753 (if address (list (intern method) address)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1754 method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1755 (nname (if method (gnus-group-prefixed-name name meth) name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1756 backend info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1757 (when (gnus-gethash nname gnus-newsrc-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1758 (error "Group %s already exists" nname))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1759 ;; Subscribe to the new group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1760 (gnus-group-change-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1761 (setq info (list t nname gnus-level-default-subscribed nil nil meth))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1762 gnus-level-default-subscribed gnus-level-killed
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1763 (and (gnus-group-group-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1764 (gnus-gethash (gnus-group-group-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1765 gnus-newsrc-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1766 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1767 ;; Make it active.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1768 (gnus-set-active nname (cons 1 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1769 (unless (gnus-ephemeral-group-p name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1770 (gnus-dribble-enter
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1771 (concat "(gnus-group-set-info '"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1772 (gnus-prin1-to-string (cdr info)) ")")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1773 ;; Insert the line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1774 (gnus-group-insert-group-line-info nname)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1775 (forward-line -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1776 (gnus-group-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1777
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1778 ;; Load the backend and try to make the backend create
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1779 ;; the group as well.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1780 (when (assoc (symbol-name (setq backend (car (gnus-server-get-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1781 nil meth))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1782 gnus-valid-select-methods)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1783 (require backend))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1784 (gnus-check-server meth)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1785 (when (gnus-check-backend-function 'request-create-group nname)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1786 (gnus-request-create-group nname nil args))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1787 t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1788
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1789 (defun gnus-group-delete-group (group &optional force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1790 "Delete the current group. Only meaningful with mail groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1791 If FORCE (the prefix) is non-nil, all the articles in the group will
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1792 be deleted. This is \"deleted\" as in \"removed forever from the face
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1793 of the Earth\". There is no undo. The user will be prompted before
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1794 doing the deletion."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1795 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1796 (list (gnus-group-group-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1797 current-prefix-arg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1798 (unless group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1799 (error "No group to rename"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1800 (unless (gnus-check-backend-function 'request-delete-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1801 (error "This backend does not support group deletion"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1802 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1803 (if (not (gnus-yes-or-no-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1804 (format
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1805 "Do you really want to delete %s%s? "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1806 group (if force " and all its contents" ""))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1807 () ; Whew!
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1808 (gnus-message 6 "Deleting group %s..." group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1809 (if (not (gnus-request-delete-group group force))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1810 (gnus-error 3 "Couldn't delete group %s" group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1811 (gnus-message 6 "Deleting group %s...done" group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1812 (gnus-group-goto-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1813 (gnus-group-kill-group 1 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1814 (gnus-sethash group nil gnus-active-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1815 t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1816 (gnus-group-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1817
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1818 (defun gnus-group-rename-group (group new-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1819 "Rename group from GROUP to NEW-NAME.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1820 When used interactively, GROUP is the group under point
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1821 and NEW-NAME will be prompted for."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1822 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1823 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1824 (gnus-group-group-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1825 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1826 (unless (gnus-check-backend-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1827 'request-rename-group (gnus-group-group-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1828 (error "This backend does not support renaming groups"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1829 (gnus-read-group "Rename group to: "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1830 (gnus-group-real-name (gnus-group-group-name))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1831
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1832 (unless (gnus-check-backend-function 'request-rename-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1833 (error "This backend does not support renaming groups"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1834 (unless group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1835 (error "No group to rename"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1836 (when (equal (gnus-group-real-name group) new-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1837 (error "Can't rename to the same name"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1838
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1839 ;; We find the proper prefixed name.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1840 (setq new-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1841 (if (equal (gnus-group-real-name new-name) new-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1842 ;; Native group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1843 new-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1844 ;; Foreign group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1845 (gnus-group-prefixed-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1846 (gnus-group-real-name new-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1847 (gnus-info-method (gnus-get-info group)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1848
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1849 (gnus-message 6 "Renaming group %s to %s..." group new-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1850 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1851 (if (not (gnus-request-rename-group group new-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1852 (gnus-error 3 "Couldn't rename group %s to %s" group new-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1853 ;; We rename the group internally by killing it...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1854 (gnus-group-goto-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1855 (gnus-group-kill-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1856 ;; ... changing its name ...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1857 (setcar (cdar gnus-list-of-killed-groups) new-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1858 ;; ... and then yanking it. Magic!
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1859 (gnus-group-yank-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1860 (gnus-set-active new-name (gnus-active group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1861 (gnus-message 6 "Renaming group %s to %s...done" group new-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1862 new-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1863 (gnus-group-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1864
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1865 (defun gnus-group-edit-group (group &optional part)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1866 "Edit the group on the current line."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1867 (interactive (list (gnus-group-group-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1868 (let ((part (or part 'info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1869 info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1870 (unless group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1871 (error "No group on current line"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1872 (unless (setq info (gnus-get-info group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1873 (error "Killed group; can't be edited"))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
1874 (ignore-errors
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
1875 (gnus-close-group group))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1876 (gnus-edit-form
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1877 ;; Find the proper form to edit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1878 (cond ((eq part 'method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1879 (or (gnus-info-method info) "native"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1880 ((eq part 'params)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1881 (gnus-info-params info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1882 (t info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1883 ;; The proper documentation.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1884 (format
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1885 "Editing the %s."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1886 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1887 ((eq part 'method) "select method")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1888 ((eq part 'params) "group parameters")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1889 (t "group info")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1890 `(lambda (form)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1891 (gnus-group-edit-group-done ',part ,group form)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1892
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1893 (defun gnus-group-edit-group-method (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1894 "Edit the select method of GROUP."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1895 (interactive (list (gnus-group-group-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1896 (gnus-group-edit-group group 'method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1897
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1898 (defun gnus-group-edit-group-parameters (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1899 "Edit the group parameters of GROUP."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1900 (interactive (list (gnus-group-group-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1901 (gnus-group-edit-group group 'params))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1902
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1903 (defun gnus-group-edit-group-done (part group form)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1904 "Update variables."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1905 (let* ((method (cond ((eq part 'info) (nth 4 form))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1906 ((eq part 'method) form)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1907 (t nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1908 (info (cond ((eq part 'info) form)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1909 ((eq part 'method) (gnus-get-info group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1910 (t nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1911 (new-group (if info
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1912 (if (or (not method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1913 (gnus-server-equal
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1914 gnus-select-method method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1915 (gnus-group-real-name (car info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1916 (gnus-group-prefixed-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1917 (gnus-group-real-name (car info)) method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1918 nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1919 (when (and new-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1920 (not (equal new-group group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1921 (when (gnus-group-goto-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1922 (gnus-group-kill-group 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1923 (gnus-activate-group new-group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1924 ;; Set the info.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1925 (if (not (and info new-group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1926 (gnus-group-set-info form (or new-group group) part)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1927 (setq info (gnus-copy-sequence info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1928 (setcar info new-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1929 (unless (gnus-server-equal method "native")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1930 (unless (nthcdr 3 info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1931 (nconc info (list nil nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1932 (unless (nthcdr 4 info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1933 (nconc info (list nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1934 (gnus-info-set-method info method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1935 (gnus-group-set-info info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1936 (gnus-group-update-group (or new-group group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1937 (gnus-group-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1938
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1939 (defun gnus-group-make-useful-group (group method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1940 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1941 (let ((entry (assoc (completing-read "Create group: " gnus-useful-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1942 nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1943 gnus-useful-groups)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1944 (list (cadr entry) (caddr entry))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1945 (setq method (gnus-copy-sequence method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1946 (let (entry)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1947 (while (setq entry (memq (assq 'eval method) method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1948 (setcar entry (eval (cadar entry)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1949 (gnus-group-make-group group method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1950
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1951 (defun gnus-group-make-help-group ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1952 "Create the Gnus documentation group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1953 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1954 (let ((name (gnus-group-prefixed-name "gnus-help" '(nndoc "gnus-help")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1955 (file (nnheader-find-etc-directory "gnus-tut.txt" t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1956 dir)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1957 (when (gnus-gethash name gnus-newsrc-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1958 (error "Documentation group already exists"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1959 (if (not file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1960 (gnus-message 1 "Couldn't find doc group")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1961 (gnus-group-make-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1962 (gnus-group-real-name name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1963 (list 'nndoc "gnus-help"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1964 (list 'nndoc-address file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1965 (list 'nndoc-article-type 'mbox)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1966 (gnus-group-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1967
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1968 (defun gnus-group-make-doc-group (file type)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1969 "Create a group that uses a single file as the source."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1970 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1971 (list (read-file-name "File name: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1972 (and current-prefix-arg 'ask)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1973 (when (eq type 'ask)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1974 (let ((err "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1975 char found)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1976 (while (not found)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1977 (message
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1978 "%sFile type (mbox, babyl, digest, forward, mmdf, guess) [mbdfag]: "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1979 err)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1980 (setq found (cond ((= (setq char (read-char)) ?m) 'mbox)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1981 ((= char ?b) 'babyl)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1982 ((= char ?d) 'digest)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1983 ((= char ?f) 'forward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1984 ((= char ?a) 'mmfd)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1985 (t (setq err (format "%c unknown. " char))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1986 nil))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1987 (setq type found)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1988 (let* ((file (expand-file-name file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1989 (name (gnus-generate-new-group-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1990 (gnus-group-prefixed-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1991 (file-name-nondirectory file) '(nndoc "")))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1992 (gnus-group-make-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1993 (gnus-group-real-name name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1994 (list 'nndoc file
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1995 (list 'nndoc-address file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1996 (list 'nndoc-article-type (or type 'guess))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1997
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1998 (defvar nnweb-type-definition)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1999 (defvar gnus-group-web-type-history nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2000 (defvar gnus-group-web-search-history nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2001 (defun gnus-group-make-web-group (&optional solid)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2002 "Create an ephemeral nnweb group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2003 If SOLID (the prefix), create a solid group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2004 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2005 (require 'nnweb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2006 (let* ((group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2007 (if solid (gnus-read-group "Group name: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2008 (message-unique-id)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2009 (type
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2010 (completing-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2011 "Search engine type: "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2012 (mapcar (lambda (elem) (list (symbol-name (car elem))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2013 nnweb-type-definition)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2014 nil t (cons (or (car gnus-group-web-type-history)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2015 (symbol-name (caar nnweb-type-definition)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2016 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2017 'gnus-group-web-type-history))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2018 (search
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2019 (read-string
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2020 "Search string: "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2021 (cons (or (car gnus-group-web-search-history) "") 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2022 'gnus-group-web-search-history))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2023 (method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2024 `(nnweb ,group (nnweb-search ,search)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2025 (nnweb-type ,(intern type))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2026 (nnweb-ephemeral-p t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2027 (if solid
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2028 (gnus-group-make-group group "nnweb" "" `(,(intern type) ,search))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2029 (gnus-group-read-ephemeral-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2030 group method t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2031 (cons (current-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2032 (if (eq major-mode 'gnus-summary-mode) 'summary 'group))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2033
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2034 (defun gnus-group-make-archive-group (&optional all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2035 "Create the (ding) Gnus archive group of the most recent articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2036 Given a prefix, create a full group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2037 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2038 (let ((group (gnus-group-prefixed-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2039 (if all "ding.archives" "ding.recent") '(nndir ""))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2040 (when (gnus-gethash group gnus-newsrc-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2041 (error "Archive group already exists"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2042 (gnus-group-make-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2043 (gnus-group-real-name group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2044 (list 'nndir (if all "hpc" "edu")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2045 (list 'nndir-directory
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2046 (if all gnus-group-archive-directory
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2047 gnus-group-recent-archive-directory))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2048 (gnus-group-add-parameter group (cons 'to-address "ding@ifi.uio.no"))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2049
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2050 (defun gnus-group-make-directory-group (dir)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2051 "Create an nndir group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2052 The user will be prompted for a directory. The contents of this
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2053 directory will be used as a newsgroup. The directory should contain
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2054 mail messages or news articles in files that have numeric names."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2055 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2056 (list (read-file-name "Create group from directory: ")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2057 (unless (file-exists-p dir)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2058 (error "No such directory"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2059 (unless (file-directory-p dir)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2060 (error "Not a directory"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2061 (let ((ext "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2062 (i 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2063 group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2064 (while (or (not group) (gnus-gethash group gnus-newsrc-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2065 (setq group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2066 (gnus-group-prefixed-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2067 (concat (file-name-as-directory (directory-file-name dir))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2068 ext)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2069 '(nndir "")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2070 (setq ext (format "<%d>" (setq i (1+ i)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2071 (gnus-group-make-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2072 (gnus-group-real-name group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2073 (list 'nndir (gnus-group-real-name group) (list 'nndir-directory dir)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2074
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2075 (defun gnus-group-make-kiboze-group (group address scores)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2076 "Create an nnkiboze group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2077 The user will be prompted for a name, a regexp to match groups, and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2078 score file entries for articles to include in the group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2079 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2080 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2081 (read-string "nnkiboze group name: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2082 (read-string "Source groups (regexp): ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2083 (let ((headers (mapcar (lambda (group) (list group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2084 '("subject" "from" "number" "date" "message-id"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2085 "references" "chars" "lines" "xref"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2086 "followup" "all" "body" "head")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2087 scores header regexp regexps)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2088 (while (not (equal "" (setq header (completing-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2089 "Match on header: " headers nil t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2090 (setq regexps nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2091 (while (not (equal "" (setq regexp (read-string
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2092 (format "Match on %s (string): "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2093 header)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2094 (push (list regexp nil nil 'r) regexps))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2095 (push (cons header regexps) scores))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2096 scores)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2097 (gnus-group-make-group group "nnkiboze" address)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2098 (nnheader-temp-write (gnus-score-file-name (concat "nnkiboze:" group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2099 (let (emacs-lisp-mode-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2100 (pp scores (current-buffer)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2101
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2102 (defun gnus-group-add-to-virtual (n vgroup)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2103 "Add the current group to a virtual group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2104 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2105 (list current-prefix-arg
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2106 (completing-read "Add to virtual group: " gnus-newsrc-hashtb nil t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2107 "nnvirtual:")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2108 (unless (eq (car (gnus-find-method-for-group vgroup)) 'nnvirtual)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2109 (error "%s is not an nnvirtual group" vgroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2110 (gnus-close-group vgroup)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2111 (let* ((groups (gnus-group-process-prefix n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2112 (method (gnus-info-method (gnus-get-info vgroup))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2113 (setcar (cdr method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2114 (concat
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2115 (nth 1 method) "\\|"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2116 (mapconcat
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2117 (lambda (s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2118 (gnus-group-remove-mark s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2119 (concat "\\(^" (regexp-quote s) "$\\)"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2120 groups "\\|"))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2121 (gnus-group-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2122
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2123 (defun gnus-group-make-empty-virtual (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2124 "Create a new, fresh, empty virtual group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2125 (interactive "sCreate new, empty virtual group: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2126 (let* ((method (list 'nnvirtual "^$"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2127 (pgroup (gnus-group-prefixed-name group method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2128 ;; Check whether it exists already.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2129 (when (gnus-gethash pgroup gnus-newsrc-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2130 (error "Group %s already exists." pgroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2131 ;; Subscribe the new group after the group on the current line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2132 (gnus-subscribe-group pgroup (gnus-group-group-name) method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2133 (gnus-group-update-group pgroup)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2134 (forward-line -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2135 (gnus-group-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2136
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2137 (defun gnus-group-enter-directory (dir)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2138 "Enter an ephemeral nneething group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2139 (interactive "DDirectory to read: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2140 (let* ((method (list 'nneething dir '(nneething-read-only t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2141 (leaf (gnus-group-prefixed-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2142 (file-name-nondirectory (directory-file-name dir))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2143 method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2144 (name (gnus-generate-new-group-name leaf)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2145 (unless (gnus-group-read-ephemeral-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2146 name method t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2147 (cons (current-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2148 (if (eq major-mode 'gnus-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2149 'summary 'group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2150 (error "Couldn't enter %s" dir))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2151
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2152 ;; Group sorting commands
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2153 ;; Suggested by Joe Hildebrand <hildjj@idaho.fuentez.com>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2154
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2155 (defun gnus-group-sort-groups (func &optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2156 "Sort the group buffer according to FUNC.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2157 If REVERSE, reverse the sorting order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2158 (interactive (list gnus-group-sort-function current-prefix-arg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2159 (funcall gnus-group-sort-alist-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2160 (gnus-make-sort-function func) reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2161 (gnus-group-list-groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2162
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2163 (defun gnus-group-sort-flat (func reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2164 ;; We peel off the dummy group from the alist.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2165 (when func
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2166 (when (equal (car (gnus-info-group gnus-newsrc-alist)) "dummy.group")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2167 (pop gnus-newsrc-alist))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2168 ;; Do the sorting.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2169 (setq gnus-newsrc-alist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2170 (sort gnus-newsrc-alist func))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2171 (when reverse
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2172 (setq gnus-newsrc-alist (nreverse gnus-newsrc-alist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2173 ;; Regenerate the hash table.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2174 (gnus-make-hashtable-from-newsrc-alist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2175
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2176 (defun gnus-group-sort-groups-by-alphabet (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2177 "Sort the group buffer alphabetically by group name.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2178 If REVERSE, sort in reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2179 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2180 (gnus-group-sort-groups 'gnus-group-sort-by-alphabet reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2181
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2182 (defun gnus-group-sort-groups-by-unread (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2183 "Sort the group buffer by number of unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2184 If REVERSE, sort in reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2185 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2186 (gnus-group-sort-groups 'gnus-group-sort-by-unread reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2187
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2188 (defun gnus-group-sort-groups-by-level (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2189 "Sort the group buffer by group level.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2190 If REVERSE, sort in reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2191 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2192 (gnus-group-sort-groups 'gnus-group-sort-by-level reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2193
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2194 (defun gnus-group-sort-groups-by-score (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2195 "Sort the group buffer by group score.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2196 If REVERSE, sort in reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2197 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2198 (gnus-group-sort-groups 'gnus-group-sort-by-score reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2199
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2200 (defun gnus-group-sort-groups-by-rank (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2201 "Sort the group buffer by group rank.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2202 If REVERSE, sort in reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2203 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2204 (gnus-group-sort-groups 'gnus-group-sort-by-rank reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2205
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2206 (defun gnus-group-sort-groups-by-method (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2207 "Sort the group buffer alphabetically by backend name.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2208 If REVERSE, sort in reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2209 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2210 (gnus-group-sort-groups 'gnus-group-sort-by-method reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2211
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2212 ;;; Selected group sorting.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2213
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2214 (defun gnus-group-sort-selected-groups (n func &optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2215 "Sort the process/prefixed groups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2216 (interactive (list current-prefix-arg gnus-group-sort-function))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2217 (let ((groups (gnus-group-process-prefix n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2218 (funcall gnus-group-sort-selected-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2219 groups (gnus-make-sort-function func) reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2220 (gnus-group-list-groups)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2221
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2222 (defun gnus-group-sort-selected-flat (groups func reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2223 (let (entries infos)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2224 ;; First find all the group entries for these groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2225 (while groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2226 (push (nthcdr 2 (gnus-gethash (pop groups) gnus-newsrc-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2227 entries))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2228 ;; Then sort the infos.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2229 (setq infos
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2230 (sort
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2231 (mapcar
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2232 (lambda (entry) (car entry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2233 (setq entries (nreverse entries)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2234 func))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2235 (when reverse
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2236 (setq infos (nreverse infos)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2237 ;; Go through all the infos and replace the old entries
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2238 ;; with the new infos.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2239 (while infos
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2240 (setcar entries (pop infos))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2241 (pop entries))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2242 ;; Update the hashtable.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2243 (gnus-make-hashtable-from-newsrc-alist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2244
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2245 (defun gnus-group-sort-selected-groups-by-alphabet (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2246 "Sort the group buffer alphabetically by group name.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2247 If REVERSE, sort in reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2248 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2249 (gnus-group-sort-selected-groups 'gnus-group-sort-by-alphabet reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2250
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2251 (defun gnus-group-sort-selected-groups-by-unread (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2252 "Sort the group buffer by number of unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2253 If REVERSE, sort in reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2254 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2255 (gnus-group-sort-selected-groups 'gnus-group-sort-by-unread reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2256
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2257 (defun gnus-group-sort-selected-groups-by-level (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2258 "Sort the group buffer by group level.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2259 If REVERSE, sort in reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2260 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2261 (gnus-group-sort-selected-groups 'gnus-group-sort-by-level reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2262
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2263 (defun gnus-group-sort-selected-groups-by-score (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2264 "Sort the group buffer by group score.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2265 If REVERSE, sort in reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2266 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2267 (gnus-group-sort-selected-groups 'gnus-group-sort-by-score reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2268
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2269 (defun gnus-group-sort-selected-groups-by-rank (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2270 "Sort the group buffer by group rank.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2271 If REVERSE, sort in reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2272 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2273 (gnus-group-sort-selected-groups 'gnus-group-sort-by-rank reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2274
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2275 (defun gnus-group-sort-selected-groups-by-method (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2276 "Sort the group buffer alphabetically by backend name.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2277 If REVERSE, sort in reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2278 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2279 (gnus-group-sort-selected-groups 'gnus-group-sort-by-method reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2280
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2281 ;;; Sorting predicates.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2282
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2283 (defun gnus-group-sort-by-alphabet (info1 info2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2284 "Sort alphabetically."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2285 (string< (gnus-info-group info1) (gnus-info-group info2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2286
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2287 (defun gnus-group-sort-by-real-name (info1 info2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2288 "Sort alphabetically on real (unprefixed) names."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2289 (string< (gnus-group-real-name (gnus-info-group info1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2290 (gnus-group-real-name (gnus-info-group info2))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2291
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2292 (defun gnus-group-sort-by-unread (info1 info2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2293 "Sort by number of unread articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2294 (let ((n1 (car (gnus-gethash (gnus-info-group info1) gnus-newsrc-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2295 (n2 (car (gnus-gethash (gnus-info-group info2) gnus-newsrc-hashtb))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2296 (< (or (and (numberp n1) n1) 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2297 (or (and (numberp n2) n2) 0))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2298
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2299 (defun gnus-group-sort-by-level (info1 info2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2300 "Sort by level."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2301 (< (gnus-info-level info1) (gnus-info-level info2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2302
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2303 (defun gnus-group-sort-by-method (info1 info2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2304 "Sort alphabetically by backend name."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2305 (string< (symbol-name (car (gnus-find-method-for-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2306 (gnus-info-group info1) info1)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2307 (symbol-name (car (gnus-find-method-for-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2308 (gnus-info-group info2) info2)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2309
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2310 (defun gnus-group-sort-by-score (info1 info2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2311 "Sort by group score."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2312 (< (gnus-info-score info1) (gnus-info-score info2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2313
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2314 (defun gnus-group-sort-by-rank (info1 info2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2315 "Sort by level and score."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2316 (let ((level1 (gnus-info-level info1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2317 (level2 (gnus-info-level info2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2318 (or (< level1 level2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2319 (and (= level1 level2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2320 (> (gnus-info-score info1) (gnus-info-score info2))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2321
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2322 ;;; Clearing data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2323
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2324 (defun gnus-group-clear-data (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2325 "Clear all marks and read ranges from the current group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2326 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2327 (gnus-group-iterate arg
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2328 (lambda (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2329 (let (info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2330 (gnus-info-clear-data (setq info (gnus-get-info group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2331 (gnus-get-unread-articles-in-group info (gnus-active group) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2332 (when (gnus-group-goto-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2333 (gnus-group-update-group-line))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2334
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2335 (defun gnus-group-clear-data-on-native-groups ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2336 "Clear all marks and read ranges from all native groups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2337 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2338 (when (gnus-yes-or-no-p "Really clear all data from almost all groups? ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2339 (let ((alist (cdr gnus-newsrc-alist))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2340 info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2341 (while (setq info (pop alist))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2342 (when (gnus-group-native-p (gnus-info-group info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2343 (gnus-info-clear-data info)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2344 (gnus-get-unread-articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2345 (gnus-dribble-enter "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2346 (when (gnus-y-or-n-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2347 "Move the cache away to avoid problems in the future? ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2348 (call-interactively 'gnus-cache-move-cache)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2349
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2350 (defun gnus-info-clear-data (info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2351 "Clear all marks and read ranges from INFO."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2352 (let ((group (gnus-info-group info)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2353 (gnus-undo-register
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2354 `(progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2355 (gnus-info-set-marks ',info ',(gnus-info-marks info) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2356 (gnus-info-set-read ',info ',(gnus-info-read info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2357 (when (gnus-group-goto-group ,group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2358 (gnus-group-update-group-line))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2359 (gnus-info-set-read info nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2360 (when (gnus-info-marks info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2361 (gnus-info-set-marks info nil))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2362
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2363 ;; Group catching up.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2364
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2365 (defun gnus-group-catchup-current (&optional n all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2366 "Mark all articles not marked as unread in current newsgroup as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2367 If prefix argument N is numeric, the ARG next newsgroups will be
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2368 caught up. If ALL is non-nil, marked articles will also be marked as
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2369 read. Cross references (Xref: header) of articles are ignored.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2370 The difference between N and actual number of newsgroups that were
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2371 caught up is returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2372 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2373 (unless (gnus-group-group-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2374 (error "No group on the current line"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2375 (let ((groups (gnus-group-process-prefix n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2376 (ret 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2377 (if (not
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2378 (or (not gnus-interactive-catchup) ;Without confirmation?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2379 gnus-expert-user
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2380 (gnus-y-or-n-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2381 (format
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2382 (if all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2383 "Do you really want to mark all articles in %s as read? "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2384 "Mark all unread articles in %s as read? ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2385 (if (= (length groups) 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2386 (car groups)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2387 (format "these %d groups" (length groups)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2388 n
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2389 (while groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2390 ;; Virtual groups have to be given special treatment.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2391 (let ((method (gnus-find-method-for-group (car groups))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2392 (when (eq 'nnvirtual (car method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2393 (nnvirtual-catchup-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2394 (gnus-group-real-name (car groups)) (nth 1 method) all)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2395 (gnus-group-remove-mark (car groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2396 (if (>= (gnus-group-group-level) gnus-level-zombie)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2397 (gnus-message 2 "Dead groups can't be caught up")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2398 (if (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2399 (gnus-group-goto-group (car groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2400 (gnus-group-catchup (car groups) all))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2401 (gnus-group-update-group-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2402 (setq ret (1+ ret))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2403 (setq groups (cdr groups)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2404 (gnus-group-next-unread-group 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2405 ret)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2406
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2407 (defun gnus-group-catchup-current-all (&optional n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2408 "Mark all articles in current newsgroup as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2409 Cross references (Xref: header) of articles are ignored."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2410 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2411 (gnus-group-catchup-current n 'all))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2412
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2413 (defun gnus-group-catchup (group &optional all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2414 "Mark all articles in GROUP as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2415 If ALL is non-nil, all articles are marked as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2416 The return value is the number of articles that were marked as read,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2417 or nil if no action could be taken."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2418 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2419 (num (car entry)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2420 ;; Do the updating only if the newsgroup isn't killed.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2421 (if (not (numberp (car entry)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2422 (gnus-message 1 "Can't catch up %s; non-active group" group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2423 ;; Do auto-expirable marks if that's required.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2424 (when (gnus-group-auto-expirable-p group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2425 (gnus-add-marked-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2426 group 'expire (gnus-list-of-unread-articles group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2427 (when all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2428 (let ((marks (nth 3 (nth 2 entry))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2429 (gnus-add-marked-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2430 group 'expire (gnus-uncompress-range (cdr (assq 'tick marks))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2431 (gnus-add-marked-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2432 group 'expire (gnus-uncompress-range (cdr (assq 'tick marks)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2433 (when entry
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2434 (gnus-update-read-articles group nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2435 ;; Also nix out the lists of marks and dormants.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2436 (when all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2437 (gnus-add-marked-articles group 'tick nil nil 'force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2438 (gnus-add-marked-articles group 'dormant nil nil 'force))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2439 (let ((gnus-newsgroup-name group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2440 (run-hooks 'gnus-group-catchup-group-hook))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2441 num))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2442
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2443 (defun gnus-group-expire-articles (&optional n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2444 "Expire all expirable articles in the current newsgroup."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2445 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2446 (let ((groups (gnus-group-process-prefix n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2447 group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2448 (unless groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2449 (error "No groups to expire"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2450 (while (setq group (pop groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2451 (gnus-group-remove-mark group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2452 (when (gnus-check-backend-function 'request-expire-articles group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2453 (gnus-message 6 "Expiring articles in %s..." group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2454 (let* ((info (gnus-get-info group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2455 (expirable (if (gnus-group-total-expirable-p group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2456 (cons nil (gnus-list-of-read-articles group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2457 (assq 'expire (gnus-info-marks info))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2458 (expiry-wait (gnus-group-find-parameter group 'expiry-wait)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2459 (when expirable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2460 (setcdr
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2461 expirable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2462 (gnus-compress-sequence
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2463 (if expiry-wait
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2464 ;; We set the expiry variables to the group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2465 ;; parameter.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2466 (let ((nnmail-expiry-wait-function nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2467 (nnmail-expiry-wait expiry-wait))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2468 (gnus-request-expire-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2469 (gnus-uncompress-sequence (cdr expirable)) group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2470 ;; Just expire using the normal expiry values.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2471 (gnus-request-expire-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2472 (gnus-uncompress-sequence (cdr expirable)) group))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2473 (gnus-close-group group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2474 (gnus-message 6 "Expiring articles in %s...done" group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2475 (gnus-group-position-point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2476
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2477 (defun gnus-group-expire-all-groups ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2478 "Expire all expirable articles in all newsgroups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2479 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2480 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2481 (gnus-message 5 "Expiring...")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2482 (let ((gnus-group-marked (mapcar (lambda (info) (gnus-info-group info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2483 (cdr gnus-newsrc-alist))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2484 (gnus-group-expire-articles nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2485 (gnus-group-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2486 (gnus-message 5 "Expiring...done"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2487
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2488 (defun gnus-group-set-current-level (n level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2489 "Set the level of the next N groups to LEVEL."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2490 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2491 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2492 current-prefix-arg
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2493 (string-to-int
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2494 (let ((s (read-string
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2495 (format "Level (default %s): "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2496 (or (gnus-group-group-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2497 gnus-level-default-subscribed)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2498 (if (string-match "^\\s-*$" s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2499 (int-to-string (or (gnus-group-group-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2500 gnus-level-default-subscribed))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2501 s)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2502 (unless (and (>= level 1) (<= level gnus-level-killed))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2503 (error "Illegal level: %d" level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2504 (let ((groups (gnus-group-process-prefix n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2505 group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2506 (while (setq group (pop groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2507 (gnus-group-remove-mark group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2508 (gnus-message 6 "Changed level of %s from %d to %d"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2509 group (or (gnus-group-group-level) gnus-level-killed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2510 level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2511 (gnus-group-change-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2512 group level (or (gnus-group-group-level) gnus-level-killed))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2513 (gnus-group-update-group-line)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2514 (gnus-group-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2515
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2516 (defun gnus-group-unsubscribe (&optional n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2517 "Unsubscribe the current group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2518 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2519 (gnus-group-unsubscribe-current-group n 'unsubscribe))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2520
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2521 (defun gnus-group-subscribe (&optional n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2522 "Unsubscribe the current group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2523 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2524 (gnus-group-unsubscribe-current-group n 'subscribe))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2525
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2526 (defun gnus-group-unsubscribe-current-group (&optional n do-sub)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2527 "Toggle subscription of the current group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2528 If given numerical prefix, toggle the N next groups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2529 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2530 (let ((groups (gnus-group-process-prefix n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2531 group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2532 (while groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2533 (setq group (car groups)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2534 groups (cdr groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2535 (gnus-group-remove-mark group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2536 (gnus-group-unsubscribe-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2537 group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2538 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2539 ((eq do-sub 'unsubscribe)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2540 gnus-level-default-unsubscribed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2541 ((eq do-sub 'subscribe)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2542 gnus-level-default-subscribed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2543 ((<= (gnus-group-group-level) gnus-level-subscribed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2544 gnus-level-default-unsubscribed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2545 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2546 gnus-level-default-subscribed))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2547 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2548 (gnus-group-update-group-line))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2549 (gnus-group-next-group 1)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2550
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2551 (defun gnus-group-unsubscribe-group (group &optional level silent)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2552 "Toggle subscription to GROUP.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2553 Killed newsgroups are subscribed. If SILENT, don't try to update the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2554 group line."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2555 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2556 (list (completing-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2557 "Group: " gnus-active-hashtb nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2558 (gnus-read-active-file-p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2559 nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2560 'gnus-group-history)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2561 (let ((newsrc (gnus-gethash group gnus-newsrc-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2562 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2563 ((string-match "^[ \t]$" group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2564 (error "Empty group name"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2565 (newsrc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2566 ;; Toggle subscription flag.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2567 (gnus-group-change-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2568 newsrc (if level level (if (<= (nth 1 (nth 2 newsrc))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2569 gnus-level-subscribed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2570 (1+ gnus-level-subscribed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2571 gnus-level-default-subscribed)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2572 (unless silent
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2573 (gnus-group-update-group group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2574 ((and (stringp group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2575 (or (not (gnus-read-active-file-p))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2576 (gnus-active group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2577 ;; Add new newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2578 (gnus-group-change-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2579 group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2580 (if level level gnus-level-default-subscribed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2581 (or (and (member group gnus-zombie-list)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2582 gnus-level-zombie)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2583 gnus-level-killed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2584 (when (gnus-group-group-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2585 (gnus-gethash (gnus-group-group-name) gnus-newsrc-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2586 (unless silent
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2587 (gnus-group-update-group group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2588 (t (error "No such newsgroup: %s" group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2589 (gnus-group-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2590
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2591 (defun gnus-group-transpose-groups (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2592 "Move the current newsgroup up N places.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2593 If given a negative prefix, move down instead. The difference between
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2594 N and the number of steps taken is returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2595 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2596 (unless (gnus-group-group-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2597 (error "No group on current line"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2598 (gnus-group-kill-group 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2599 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2600 (forward-line (- n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2601 (gnus-group-yank-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2602 (gnus-group-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2603
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2604 (defun gnus-group-kill-all-zombies ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2605 "Kill all zombie newsgroups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2606 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2607 (setq gnus-killed-list (nconc gnus-zombie-list gnus-killed-list))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2608 (setq gnus-zombie-list nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2609 (gnus-group-list-groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2610
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2611 (defun gnus-group-kill-region (begin end)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2612 "Kill newsgroups in current region (excluding current point).
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2613 The killed newsgroups can be yanked by using \\[gnus-group-yank-group]."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2614 (interactive "r")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2615 (let ((lines
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2616 ;; Count lines.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2617 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2618 (count-lines
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2619 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2620 (goto-char begin)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2621 (beginning-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2622 (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2623 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2624 (goto-char end)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2625 (beginning-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2626 (point))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2627 (goto-char begin)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2628 (beginning-of-line) ;Important when LINES < 1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2629 (gnus-group-kill-group lines)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2630
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2631 (defun gnus-group-kill-group (&optional n discard)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2632 "Kill the next N groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2633 The killed newsgroups can be yanked by using \\[gnus-group-yank-group].
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2634 However, only groups that were alive can be yanked; already killed
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2635 groups or zombie groups can't be yanked.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2636 The return value is the name of the group that was killed, or a list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2637 of groups killed."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2638 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2639 (let ((buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2640 (groups (gnus-group-process-prefix n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2641 group entry level out)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2642 (if (< (length groups) 10)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2643 ;; This is faster when there are few groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2644 (while groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2645 (push (setq group (pop groups)) out)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2646 (gnus-group-remove-mark group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2647 (setq level (gnus-group-group-level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2648 (gnus-delete-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2649 (when (and (not discard)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2650 (setq entry (gnus-gethash group gnus-newsrc-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2651 (gnus-undo-register
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2652 `(progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2653 (gnus-group-goto-group ,(gnus-group-group-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2654 (gnus-group-yank-group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2655 (push (cons (car entry) (nth 2 entry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2656 gnus-list-of-killed-groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2657 (gnus-group-change-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2658 (if entry entry group) gnus-level-killed (if entry nil level)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2659 ;; If there are lots and lots of groups to be killed, we use
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2660 ;; this thing instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2661 (let (entry)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2662 (setq groups (nreverse groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2663 (while groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2664 (gnus-group-remove-mark (setq group (pop groups)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2665 (gnus-delete-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2666 (push group gnus-killed-list)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2667 (setq gnus-newsrc-alist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2668 (delq (assoc group gnus-newsrc-alist)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2669 gnus-newsrc-alist))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2670 (when gnus-group-change-level-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2671 (funcall gnus-group-change-level-function group 9 3))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2672 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2673 ((setq entry (gnus-gethash group gnus-newsrc-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2674 (push (cons (car entry) (nth 2 entry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2675 gnus-list-of-killed-groups)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2676 (setcdr (cdr entry) (cdddr entry)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2677 ((member group gnus-zombie-list)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2678 (setq gnus-zombie-list (delete group gnus-zombie-list)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2679 (gnus-make-hashtable-from-newsrc-alist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2680
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2681 (gnus-group-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2682 (if (< (length out) 2) (car out) (nreverse out))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2683
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2684 (defun gnus-group-yank-group (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2685 "Yank the last newsgroups killed with \\[gnus-group-kill-group],
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2686 inserting it before the current newsgroup. The numeric ARG specifies
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2687 how many newsgroups are to be yanked. The name of the newsgroup yanked
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2688 is returned, or (if several groups are yanked) a list of yanked groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2689 is returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2690 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2691 (setq arg (or arg 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2692 (let (info group prev out)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2693 (while (>= (decf arg) 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2694 (when (not (setq info (pop gnus-list-of-killed-groups)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2695 (error "No more newsgroups to yank"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2696 (push (setq group (nth 1 info)) out)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2697 ;; Find which newsgroup to insert this one before - search
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2698 ;; backward until something suitable is found. If there are no
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2699 ;; other newsgroups in this buffer, just make this newsgroup the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2700 ;; first newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2701 (setq prev (gnus-group-group-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2702 (gnus-group-change-level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2703 info (gnus-info-level (cdr info)) gnus-level-killed
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2704 (and prev (gnus-gethash prev gnus-newsrc-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2705 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2706 (gnus-group-insert-group-line-info group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2707 (gnus-undo-register
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2708 `(when (gnus-group-goto-group ,group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2709 (gnus-group-kill-group 1))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2710 (forward-line -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2711 (gnus-group-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2712 (if (< (length out) 2) (car out) (nreverse out))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2713
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2714 (defun gnus-group-kill-level (level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2715 "Kill all groups that is on a certain LEVEL."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2716 (interactive "nKill all groups on level: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2717 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2718 ((= level gnus-level-zombie)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2719 (setq gnus-killed-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2720 (nconc gnus-zombie-list gnus-killed-list))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2721 (setq gnus-zombie-list nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2722 ((and (< level gnus-level-zombie)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2723 (> level 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2724 (or gnus-expert-user
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2725 (gnus-yes-or-no-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2726 (format
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2727 "Do you really want to kill all groups on level %d? "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2728 level))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2729 (let* ((prev gnus-newsrc-alist)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2730 (alist (cdr prev)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2731 (while alist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2732 (if (= (gnus-info-level (car alist)) level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2733 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2734 (push (gnus-info-group (car alist)) gnus-killed-list)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2735 (setcdr prev (cdr alist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2736 (setq prev alist))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2737 (setq alist (cdr alist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2738 (gnus-make-hashtable-from-newsrc-alist)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2739 (gnus-group-list-groups)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2740 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2741 (error "Can't kill; illegal level: %d" level))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2742
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2743 (defun gnus-group-list-all-groups (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2744 "List all newsgroups with level ARG or lower.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2745 Default is gnus-level-unsubscribed, which lists all subscribed and most
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2746 unsubscribed groups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2747 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2748 (gnus-group-list-groups (or arg gnus-level-unsubscribed) t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2749
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2750 ;; Redefine this to list ALL killed groups if prefix arg used.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2751 ;; Rewritten by engstrom@src.honeywell.com (Eric Engstrom).
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2752 (defun gnus-group-list-killed (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2753 "List all killed newsgroups in the group buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2754 If ARG is non-nil, list ALL killed groups known to Gnus. This may
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2755 entail asking the server for the groups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2756 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2757 ;; Find all possible killed newsgroups if arg.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2758 (when arg
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2759 (gnus-get-killed-groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2760 (if (not gnus-killed-list)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2761 (gnus-message 6 "No killed groups")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2762 (let (gnus-group-list-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2763 (funcall gnus-group-prepare-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2764 gnus-level-killed t gnus-level-killed))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2765 (goto-char (point-min)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2766 (gnus-group-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2767
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2768 (defun gnus-group-list-zombies ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2769 "List all zombie newsgroups in the group buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2770 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2771 (if (not gnus-zombie-list)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2772 (gnus-message 6 "No zombie groups")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2773 (let (gnus-group-list-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2774 (funcall gnus-group-prepare-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2775 gnus-level-zombie t gnus-level-zombie))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2776 (goto-char (point-min)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2777 (gnus-group-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2778
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2779 (defun gnus-group-list-active ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2780 "List all groups that are available from the server(s)."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2781 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2782 ;; First we make sure that we have really read the active file.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2783 (unless (gnus-read-active-file-p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2784 (let ((gnus-read-active-file t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2785 (gnus-read-active-file)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2786 ;; Find all groups and sort them.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2787 (let ((groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2788 (sort
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2789 (let (list)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2790 (mapatoms
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2791 (lambda (sym)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2792 (and (boundp sym)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2793 (symbol-value sym)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2794 (push (symbol-name sym) list)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2795 gnus-active-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2796 list)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2797 'string<))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2798 (buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2799 group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2800 (erase-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2801 (while groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2802 (gnus-add-text-properties
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2803 (point) (prog1 (1+ (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2804 (insert " *: "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2805 (setq group (pop groups)) "\n"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2806 (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2807 'gnus-unread t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2808 'gnus-level (inline (gnus-group-level group)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2809 (goto-char (point-min))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2810
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2811 (defun gnus-activate-all-groups (level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2812 "Activate absolutely all groups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2813 (interactive (list 7))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2814 (let ((gnus-activate-level level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2815 (gnus-activate-foreign-newsgroups level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2816 (gnus-group-get-new-news)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2817
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2818 (defun gnus-group-get-new-news (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2819 "Get newly arrived articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2820 If ARG is a number, it specifies which levels you are interested in
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2821 re-scanning. If ARG is non-nil and not a number, this will force
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2822 \"hard\" re-reading of the active files from all servers."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2823 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2824 (run-hooks 'gnus-get-new-news-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2825
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2826 ;; Read any slave files.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2827 (unless gnus-slave
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2828 (gnus-master-read-slave-newsrc))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2829
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2830 ;; We might read in new NoCeM messages here.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2831 (when (and gnus-use-nocem
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2832 (null arg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2833 (gnus-nocem-scan-groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2834 ;; If ARG is not a number, then we read the active file.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2835 (when (and arg (not (numberp arg)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2836 (let ((gnus-read-active-file t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2837 (gnus-read-active-file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2838 (setq arg nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2839
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2840 ;; If the user wants it, we scan for new groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2841 (when (eq gnus-check-new-newsgroups 'always)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2842 (gnus-find-new-newsgroups)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2843
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2844 (setq arg (gnus-group-default-level arg t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2845 (if (and gnus-read-active-file (not arg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2846 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2847 (gnus-read-active-file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2848 (gnus-get-unread-articles arg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2849 (let ((gnus-read-active-file (if arg nil gnus-read-active-file)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2850 (gnus-get-unread-articles arg)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2851 (run-hooks 'gnus-after-getting-new-news-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2852 (gnus-group-list-groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2853
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2854 (defun gnus-group-get-new-news-this-group (&optional n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2855 "Check for newly arrived news in the current group (and the N-1 next groups).
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2856 The difference between N and the number of newsgroup checked is returned.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2857 If N is negative, this group and the N-1 previous groups will be checked."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2858 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2859 (let* ((groups (gnus-group-process-prefix n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2860 (ret (if (numberp n) (- n (length groups)) 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2861 (beg (unless n
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2862 (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2863 group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2864 (while (setq group (pop groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2865 (gnus-group-remove-mark group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2866 ;; Bypass any previous denials from the server.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2867 (gnus-remove-denial (gnus-find-method-for-group group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2868 (if (gnus-activate-group group 'scan)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2869 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2870 (gnus-get-unread-articles-in-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2871 (gnus-get-info group) (gnus-active group) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2872 (unless (gnus-virtual-group-p group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2873 (gnus-close-group group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2874 (gnus-group-update-group group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2875 (if (eq (gnus-server-status (gnus-find-method-for-group group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2876 'denied)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2877 (gnus-error 3 "Server denied access")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2878 (gnus-error 3 "%s error: %s" group (gnus-status-message group)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2879 (when beg
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2880 (goto-char beg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2881 (when gnus-goto-next-group-when-activating
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2882 (gnus-group-next-unread-group 1 t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2883 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2884 ret))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2885
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2886 (defun gnus-group-fetch-faq (group &optional faq-dir)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2887 "Fetch the FAQ for the current group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2888 If given a prefix argument, prompt for the FAQ dir
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2889 to use."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2890 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2891 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2892 (gnus-group-group-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2893 (cond (current-prefix-arg
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2894 (completing-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2895 "Faq dir: " (and (listp gnus-group-faq-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2896 (mapcar (lambda (file) (list file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2897 gnus-group-faq-directory)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2898 (unless group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2899 (error "No group name given"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2900 (let ((dirs (or faq-dir gnus-group-faq-directory))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2901 dir found file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2902 (unless (listp dirs)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2903 (setq dirs (list dirs)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2904 (while (and (not found)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2905 (setq dir (pop dirs)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2906 (setq file (concat (file-name-as-directory dir)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2907 (gnus-group-real-name group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2908 (if (not (file-exists-p file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2909 (gnus-message 1 "No such file: %s" file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2910 (let ((enable-local-variables nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2911 (find-file file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2912 (setq found t))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2913
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2914 (defun gnus-group-describe-group (force &optional group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2915 "Display a description of the current newsgroup."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2916 (interactive (list current-prefix-arg (gnus-group-group-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2917 (let* ((method (gnus-find-method-for-group group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2918 (mname (gnus-group-prefixed-name "" method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2919 desc)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2920 (when (and force
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2921 gnus-description-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2922 (gnus-sethash mname nil gnus-description-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2923 (unless group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2924 (error "No group name given"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2925 (when (or (and gnus-description-hashtb
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2926 ;; We check whether this group's method has been
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2927 ;; queried for a description file.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2928 (gnus-gethash mname gnus-description-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2929 (setq desc (gnus-group-get-description group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2930 (gnus-read-descriptions-file method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2931 (gnus-message 1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2932 (or desc (gnus-gethash group gnus-description-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2933 "No description available")))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2934
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2935 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2936 (defun gnus-group-describe-all-groups (&optional force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2937 "Pop up a buffer with descriptions of all newsgroups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2938 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2939 (when force
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2940 (setq gnus-description-hashtb nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2941 (when (not (or gnus-description-hashtb
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2942 (gnus-read-all-descriptions-files)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2943 (error "Couldn't request descriptions file"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2944 (let ((buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2945 b)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2946 (erase-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2947 (mapatoms
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2948 (lambda (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2949 (setq b (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2950 (insert (format " *: %-20s %s\n" (symbol-name group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2951 (symbol-value group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2952 (gnus-add-text-properties
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2953 b (1+ b) (list 'gnus-group group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2954 'gnus-unread t 'gnus-marked nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2955 'gnus-level (1+ gnus-level-subscribed))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2956 gnus-description-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2957 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2958 (gnus-group-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2959
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2960 ;; Suggested by Daniel Quinlan <quinlan@best.com>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2961 (defun gnus-group-apropos (regexp &optional search-description)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2962 "List all newsgroups that have names that match a regexp."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2963 (interactive "sGnus apropos (regexp): ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2964 (let ((prev "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2965 (obuf (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2966 groups des)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2967 ;; Go through all newsgroups that are known to Gnus.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2968 (mapatoms
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2969 (lambda (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2970 (and (symbol-name group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2971 (string-match regexp (symbol-name group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2972 (push (symbol-name group) groups)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2973 gnus-active-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2974 ;; Also go through all descriptions that are known to Gnus.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2975 (when search-description
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2976 (mapatoms
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2977 (lambda (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2978 (and (string-match regexp (symbol-value group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2979 (gnus-active (symbol-name group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2980 (push (symbol-name group) groups)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2981 gnus-description-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2982 (if (not groups)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2983 (gnus-message 3 "No groups matched \"%s\"." regexp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2984 ;; Print out all the groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2985 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2986 (pop-to-buffer "*Gnus Help*")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2987 (buffer-disable-undo (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2988 (erase-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2989 (setq groups (sort groups 'string<))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2990 (while groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2991 ;; Groups may be entered twice into the list of groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2992 (when (not (string= (car groups) prev))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2993 (insert (setq prev (car groups)) "\n")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2994 (when (and gnus-description-hashtb
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2995 (setq des (gnus-gethash (car groups)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2996 gnus-description-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2997 (insert " " des "\n")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2998 (setq groups (cdr groups)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2999 (goto-char (point-min))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3000 (pop-to-buffer obuf)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3001
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3002 (defun gnus-group-description-apropos (regexp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3003 "List all newsgroups that have names or descriptions that match a regexp."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3004 (interactive "sGnus description apropos (regexp): ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3005 (when (not (or gnus-description-hashtb
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3006 (gnus-read-all-descriptions-files)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3007 (error "Couldn't request descriptions file"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3008 (gnus-group-apropos regexp t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3009
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3010 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3011 (defun gnus-group-list-matching (level regexp &optional all lowest)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3012 "List all groups with unread articles that match REGEXP.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3013 If the prefix LEVEL is non-nil, it should be a number that says which
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3014 level to cut off listing groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3015 If ALL, also list groups with no unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3016 If LOWEST, don't list groups with level lower than LOWEST.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3017
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3018 This command may read the active file."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3019 (interactive "P\nsList newsgroups matching: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3020 ;; First make sure active file has been read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3021 (when (and level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3022 (> (prefix-numeric-value level) gnus-level-killed))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3023 (gnus-get-killed-groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3024 (gnus-group-prepare-flat
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3025 (or level gnus-level-subscribed) all (or lowest 1) regexp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3026 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3027 (gnus-group-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3028
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3029 (defun gnus-group-list-all-matching (level regexp &optional lowest)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3030 "List all groups that match REGEXP.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3031 If the prefix LEVEL is non-nil, it should be a number that says which
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3032 level to cut off listing groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3033 If LOWEST, don't list groups with level lower than LOWEST."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3034 (interactive "P\nsList newsgroups matching: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3035 (when level
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3036 (setq level (prefix-numeric-value level)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3037 (gnus-group-list-matching (or level gnus-level-killed) regexp t lowest))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3038
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3039 ;; Suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3040 (defun gnus-group-save-newsrc (&optional force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3041 "Save the Gnus startup files.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3042 If FORCE, force saving whether it is necessary or not."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3043 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3044 (gnus-save-newsrc-file force))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3045
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3046 (defun gnus-group-restart (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3047 "Force Gnus to read the .newsrc file."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3048 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3049 (when (gnus-yes-or-no-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3050 (format "Are you sure you want to restart Gnus? "))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3051 (gnus-save-newsrc-file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3052 (gnus-clear-system)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3053 (gnus)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3054
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3055 (defun gnus-group-read-init-file ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3056 "Read the Gnus elisp init file."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3057 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3058 (gnus-read-init-file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3059
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3060 (defun gnus-group-check-bogus-groups (&optional silent)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3061 "Check bogus newsgroups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3062 If given a prefix, don't ask for confirmation before removing a bogus
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3063 group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3064 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3065 (gnus-check-bogus-newsgroups (and (not silent) (not gnus-expert-user)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3066 (gnus-group-list-groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3067
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3068 (defun gnus-group-edit-global-kill (&optional article group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3069 "Edit the global kill file.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3070 If GROUP, edit that local kill file instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3071 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3072 (setq gnus-current-kill-article article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3073 (gnus-kill-file-edit-file group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3074 (gnus-message
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3075 6
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3076 (substitute-command-keys
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3077 (format "Editing a %s kill file (Type \\[gnus-kill-file-exit] to exit)"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3078 (if group "local" "global")))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3079
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3080 (defun gnus-group-edit-local-kill (article group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3081 "Edit a local kill file."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3082 (interactive (list nil (gnus-group-group-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3083 (gnus-group-edit-global-kill article group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3084
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3085 (defun gnus-group-force-update ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3086 "Update `.newsrc' file."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3087 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3088 (gnus-save-newsrc-file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3089
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3090 (defun gnus-group-suspend ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3091 "Suspend the current Gnus session.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3092 In fact, cleanup buffers except for group mode buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3093 The hook gnus-suspend-gnus-hook is called before actually suspending."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3094 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3095 (run-hooks 'gnus-suspend-gnus-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3096 ;; Kill Gnus buffers except for group mode buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3097 (let* ((group-buf (get-buffer gnus-group-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3098 ;; Do this on a separate list in case the user does a ^G before we finish
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3099 (gnus-buffer-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3100 (delete group-buf (delete gnus-dribble-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3101 (append gnus-buffer-list nil)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3102 (while gnus-buffer-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3103 (gnus-kill-buffer (pop gnus-buffer-list)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3104 (gnus-kill-gnus-frames)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3105 (when group-buf
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3106 (setq gnus-buffer-list (list group-buf))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3107 (bury-buffer group-buf)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3108 (delete-windows-on group-buf t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3109
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3110 (defun gnus-group-clear-dribble ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3111 "Clear all information from the dribble buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3112 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3113 (gnus-dribble-clear)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3114 (gnus-message 7 "Cleared dribble buffer"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3115
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3116 (defun gnus-group-exit ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3117 "Quit reading news after updating .newsrc.eld and .newsrc.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3118 The hook `gnus-exit-gnus-hook' is called before actually exiting."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3119 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3120 (when
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3121 (or noninteractive ;For gnus-batch-kill
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3122 (not gnus-interactive-exit) ;Without confirmation
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3123 gnus-expert-user
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3124 (gnus-y-or-n-p "Are you sure you want to quit reading news? "))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3125 (run-hooks 'gnus-exit-gnus-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3126 ;; Offer to save data from non-quitted summary buffers.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3127 (gnus-offer-save-summaries)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3128 ;; Save the newsrc file(s).
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3129 (gnus-save-newsrc-file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3130 ;; Kill-em-all.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3131 (gnus-close-backends)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3132 ;; Reset everything.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3133 (gnus-clear-system)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3134 ;; Allow the user to do things after cleaning up.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3135 (run-hooks 'gnus-after-exiting-gnus-hook)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3136
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3137 (defun gnus-group-quit ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3138 "Quit reading news without updating .newsrc.eld or .newsrc.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3139 The hook `gnus-exit-gnus-hook' is called before actually exiting."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3140 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3141 (when (or noninteractive ;For gnus-batch-kill
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3142 (zerop (buffer-size))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3143 (not (gnus-server-opened gnus-select-method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3144 gnus-expert-user
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3145 (not gnus-current-startup-file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3146 (gnus-yes-or-no-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3147 (format "Quit reading news without saving %s? "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3148 (file-name-nondirectory gnus-current-startup-file))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3149 (run-hooks 'gnus-exit-gnus-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3150 (gnus-configure-windows 'group t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3151 (gnus-dribble-save)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3152 (gnus-close-backends)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3153 (gnus-clear-system)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3154 (gnus-kill-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3155 ;; Allow the user to do things after cleaning up.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3156 (run-hooks 'gnus-after-exiting-gnus-hook)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3157
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3158 (defun gnus-group-describe-briefly ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3159 "Give a one line description of the group mode commands."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3160 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3161 (gnus-message 7 (substitute-command-keys "\\<gnus-group-mode-map>\\[gnus-group-read-group]:Select \\[gnus-group-next-unread-group]:Forward \\[gnus-group-prev-unread-group]:Backward \\[gnus-group-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-group-describe-briefly]:This help")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3162
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3163 (defun gnus-group-browse-foreign-server (method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3164 "Browse a foreign news server.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3165 If called interactively, this function will ask for a select method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3166 (nntp, nnspool, etc.) and a server address (eg. nntp.some.where).
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3167 If not, METHOD should be a list where the first element is the method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3168 and the second element is the address."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3169 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3170 (list (let ((how (completing-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3171 "Which backend: "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3172 (append gnus-valid-select-methods gnus-server-alist)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3173 nil t (cons "nntp" 0) 'gnus-method-history)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3174 ;; We either got a backend name or a virtual server name.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3175 ;; If the first, we also need an address.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3176 (if (assoc how gnus-valid-select-methods)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3177 (list (intern how)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3178 ;; Suggested by mapjph@bath.ac.uk.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3179 (completing-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3180 "Address: "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3181 (mapcar (lambda (server) (list server))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3182 gnus-secondary-servers)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3183 ;; We got a server name, so we find the method.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3184 (gnus-server-to-method how)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3185 (gnus-browse-foreign-server method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3186
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3187 (defun gnus-group-set-info (info &optional method-only-group part)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3188 (let* ((entry (gnus-gethash
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3189 (or method-only-group (gnus-info-group info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3190 gnus-newsrc-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3191 (part-info info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3192 (info (if method-only-group (nth 2 entry) info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3193 method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3194 (when method-only-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3195 (unless entry
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3196 (error "Trying to change non-existent group %s" method-only-group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3197 ;; We have received parts of the actual group info - either the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3198 ;; select method or the group parameters. We first check
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3199 ;; whether we have to extend the info, and if so, do that.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3200 (let ((len (length info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3201 (total (if (eq part 'method) 5 6)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3202 (when (< len total)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3203 (setcdr (nthcdr (1- len) info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3204 (make-list (- total len) nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3205 ;; Then we enter the new info.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3206 (setcar (nthcdr (1- total) info) part-info)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3207 (unless entry
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3208 ;; This is a new group, so we just create it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3209 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3210 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3211 (setq method (gnus-info-method info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3212 (when (gnus-server-equal method "native")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3213 (setq method nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3214 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3215 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3216 (if method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3217 ;; It's a foreign group...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3218 (gnus-group-make-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3219 (gnus-group-real-name (gnus-info-group info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3220 (if (stringp method) method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3221 (prin1-to-string (car method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3222 (and (consp method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3223 (nth 1 (gnus-info-method info))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3224 ;; It's a native group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3225 (gnus-group-make-group (gnus-info-group info))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3226 (gnus-message 6 "Note: New group created")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3227 (setq entry
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3228 (gnus-gethash (gnus-group-prefixed-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3229 (gnus-group-real-name (gnus-info-group info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3230 (or (gnus-info-method info) gnus-select-method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3231 gnus-newsrc-hashtb))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3232 ;; Whether it was a new group or not, we now have the entry, so we
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3233 ;; can do the update.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3234 (if entry
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3235 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3236 (setcar (nthcdr 2 entry) info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3237 (when (and (not (eq (car entry) t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3238 (gnus-active (gnus-info-group info)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3239 (setcar entry (length (gnus-list-of-unread-articles (car info))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3240 (error "No such group: %s" (gnus-info-group info)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3241
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3242 (defun gnus-group-set-method-info (group select-method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3243 (gnus-group-set-info select-method group 'method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3244
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3245 (defun gnus-group-set-params-info (group params)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3246 (gnus-group-set-info params group 'params))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3247
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3248 (defun gnus-add-marked-articles (group type articles &optional info force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3249 ;; Add ARTICLES of TYPE to the info of GROUP.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3250 ;; If INFO is non-nil, use that info. If FORCE is non-nil, don't
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3251 ;; add, but replace marked articles of TYPE with ARTICLES.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3252 (let ((info (or info (gnus-get-info group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3253 (uncompressed '(score bookmark killed))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3254 marked m)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3255 (or (not info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3256 (and (not (setq marked (nthcdr 3 info)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3257 (or (null articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3258 (setcdr (nthcdr 2 info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3259 (list (list (cons type (gnus-compress-sequence
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3260 articles t)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3261 (and (not (setq m (assq type (car marked))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3262 (or (null articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3263 (setcar marked
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3264 (cons (cons type (gnus-compress-sequence articles t) )
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3265 (car marked)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3266 (if force
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3267 (if (null articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3268 (setcar (nthcdr 3 info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3269 (delq (assq type (car marked)) (car marked)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3270 (setcdr m (gnus-compress-sequence articles t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3271 (setcdr m (gnus-compress-sequence
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3272 (sort (nconc (gnus-uncompress-range (cdr m))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3273 (copy-sequence articles)) '<) t))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3274
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3275 ;;;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3276 ;;; Group timestamps
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3277 ;;;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3278
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3279 (defun gnus-group-set-timestamp ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3280 "Change the timestamp of the current group to the current time.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3281 This function can be used in hooks like `gnus-select-group-hook'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3282 or `gnus-group-catchup-group-hook'."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3283 (when gnus-newsgroup-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3284 (let ((time (current-time)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3285 (setcdr (cdr time) nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3286 (gnus-group-set-parameter gnus-newsgroup-name 'timestamp time))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3287
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3288 (defsubst gnus-group-timestamp (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3289 "Return the timestamp for GROUP."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3290 (gnus-group-get-parameter group 'timestamp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3291
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3292 (defun gnus-group-timestamp-delta (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3293 "Return the offset in seconds from the timestamp for GROUP to the current time, as a floating point number."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3294 (let* ((time (or (gnus-group-timestamp group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3295 (list 0 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3296 (delta (gnus-time-minus (current-time) time)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3297 (+ (* (nth 0 delta) 65536.0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3298 (nth 1 delta))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3299
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3300 (defun gnus-group-timestamp-string (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3301 "Return a string of the timestamp for GROUP."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3302 (let ((time (gnus-group-timestamp group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3303 (if (not time)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3304 ""
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3305 (gnus-time-iso8601 time))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3306
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3307 (provide 'gnus-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3308
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3309 ;;; gnus-group.el ends here