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