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