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