comparison lisp/gnus/gnus-group.el @ 82951:0fde48feb604

Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
author Andreas Schwab <schwab@suse.de>
date Thu, 22 Jul 2004 16:45:51 +0000
parents 695cf19ef79e
children 590114f9753d
comparison
equal deleted inserted replaced
56503:8bbd2323fbf2 82951:0fde48feb604
1 ;;; gnus-group.el --- group mode commands for Gnus 1 ;;; gnus-group.el --- group mode commands for Gnus
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000 2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
3 ;; Free Software Foundation, Inc. 3 ;; Free Software Foundation, Inc.
4 4
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> 5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6 ;; Keywords: news 6 ;; Keywords: news
7 7
24 24
25 ;;; Commentary: 25 ;;; Commentary:
26 26
27 ;;; Code: 27 ;;; Code:
28 28
29 (eval-when-compile (require 'cl)) 29 (eval-when-compile
30 (require 'cl)
31 (defvar tool-bar-map))
30 32
31 (require 'gnus) 33 (require 'gnus)
32 (require 'gnus-start) 34 (require 'gnus-start)
33 (require 'nnmail) 35 (require 'nnmail)
34 (require 'gnus-spec) 36 (require 'gnus-spec)
35 (require 'gnus-int) 37 (require 'gnus-int)
36 (require 'gnus-range) 38 (require 'gnus-range)
37 (require 'gnus-win) 39 (require 'gnus-win)
38 (require 'gnus-undo) 40 (require 'gnus-undo)
39 (require 'time-date) 41 (require 'time-date)
42 (require 'gnus-ems)
43
44 (eval-when-compile (require 'mm-url))
40 45
41 (defcustom gnus-group-archive-directory 46 (defcustom gnus-group-archive-directory
42 "*ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list/" 47 "*ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list/"
43 "*The address of the (ding) archives." 48 "*The address of the (ding) archives."
44 :group 'gnus-group-foreign 49 :group 'gnus-group-foreign
115 "*Function used for sorting the group buffer. 120 "*Function used for sorting the group buffer.
116 This function will be called with group info entries as the arguments 121 This function will be called with group info entries as the arguments
117 for the groups to be sorted. Pre-made functions include 122 for the groups to be sorted. Pre-made functions include
118 `gnus-group-sort-by-alphabet', `gnus-group-sort-by-real-name', 123 `gnus-group-sort-by-alphabet', `gnus-group-sort-by-real-name',
119 `gnus-group-sort-by-unread', `gnus-group-sort-by-level', 124 `gnus-group-sort-by-unread', `gnus-group-sort-by-level',
120 `gnus-group-sort-by-score', `gnus-group-sort-by-method', and 125 `gnus-group-sort-by-score', `gnus-group-sort-by-method',
121 `gnus-group-sort-by-rank'. 126 `gnus-group-sort-by-server', and `gnus-group-sort-by-rank'.
122 127
123 This variable can also be a list of sorting functions. In that case, 128 This variable can also be a list of sorting functions. In that case,
124 the most significant sort function should be the last function in the 129 the most significant sort function should be the last function in the
125 list." 130 list."
126 :group 'gnus-group-listing 131 :group 'gnus-group-listing
127 :link '(custom-manual "(gnus)Sorting Groups") 132 :link '(custom-manual "(gnus)Sorting Groups")
128 :type '(radio (function-item gnus-group-sort-by-alphabet) 133 :type '(repeat :value-to-internal (lambda (widget value)
129 (function-item gnus-group-sort-by-real-name) 134 (if (listp value) value (list value)))
130 (function-item gnus-group-sort-by-unread) 135 :match (lambda (widget value)
131 (function-item gnus-group-sort-by-level) 136 (or (symbolp value)
132 (function-item gnus-group-sort-by-score) 137 (widget-editable-list-match widget value)))
133 (function-item gnus-group-sort-by-method) 138 (choice (function-item gnus-group-sort-by-alphabet)
134 (function-item gnus-group-sort-by-rank) 139 (function-item gnus-group-sort-by-real-name)
135 (function :tag "other" nil))) 140 (function-item gnus-group-sort-by-unread)
136 141 (function-item gnus-group-sort-by-level)
137 (defcustom gnus-group-line-format "%M\%S\%p\%P\%5y: %(%g%)%l\n" 142 (function-item gnus-group-sort-by-score)
143 (function-item gnus-group-sort-by-method)
144 (function-item gnus-group-sort-by-server)
145 (function-item gnus-group-sort-by-rank)
146 (function :tag "other" nil))))
147
148 (defcustom gnus-group-line-format "%M\%S\%p\%P\%5y:%B%(%g%)%l %O\n"
138 "*Format of group lines. 149 "*Format of group lines.
139 It works along the same lines as a normal formatting string, 150 It works along the same lines as a normal formatting string,
140 with some simple extensions. 151 with some simple extensions.
141 152
142 %M Only marked articles (character, \"*\" or \" \") 153 %M Only marked articles (character, \"*\" or \" \")
145 %N Number of unread articles (integer) 156 %N Number of unread articles (integer)
146 %I Number of dormant articles (integer) 157 %I Number of dormant articles (integer)
147 %i Number of ticked and dormant (integer) 158 %i Number of ticked and dormant (integer)
148 %T Number of ticked articles (integer) 159 %T Number of ticked articles (integer)
149 %R Number of read articles (integer) 160 %R Number of read articles (integer)
161 %U Number of unseen articles (integer)
150 %t Estimated total number of articles (integer) 162 %t Estimated total number of articles (integer)
151 %y Number of unread, unticked articles (integer) 163 %y Number of unread, unticked articles (integer)
152 %G Group name (string) 164 %G Group name (string)
153 %g Qualified group name (string) 165 %g Qualified group name (string)
166 %c Short (collapsed) group name. See `gnus-group-uncollapsed-levels'.
167 %C Group comment (string)
154 %D Group description (string) 168 %D Group description (string)
155 %s Select method (string) 169 %s Select method (string)
156 %o Moderated group (char, \"m\") 170 %o Moderated group (char, \"m\")
157 %p Process mark (char) 171 %p Process mark (char)
172 %B Whether a summary buffer for the group is open (char, \"*\")
158 %O Moderated group (string, \"(m)\" or \"\") 173 %O Moderated group (string, \"(m)\" or \"\")
159 %P Topic indentation (string) 174 %P Topic indentation (string)
160 %m Whether there is new(ish) mail in the group (char, \"%\") 175 %m Whether there is new(ish) mail in the group (char, \"%\")
161 %l Whether there are GroupLens predictions for this group (string) 176 %l Whether there are GroupLens predictions for this group (string)
162 %n Select from where (string) 177 %n Select from where (string)
163 %z A string that look like `<%s:%n>' if a foreign select method is used 178 %z A string that look like `<%s:%n>' if a foreign select method is used
164 %d The date the group was last entered. 179 %d The date the group was last entered.
165 %E Icon as defined by `gnus-group-icon-list'. 180 %E Icon as defined by `gnus-group-icon-list'.
166 %u User defined specifier. The next character in the format string should 181 %u User defined specifier. The next character in the format string should
167 be a letter. Gnus will call the function gnus-user-format-function-X, 182 be a letter. Gnus will call the function gnus-user-format-function-X,
168 where X is the letter following %u. The function will be passed the 183 where X is the letter following %u. The function will be passed a
169 current header as argument. The function should return a string, which 184 single dummy parameter as argument. The function should return a
170 will be inserted into the buffer just like information from any other 185 string, which will be inserted into the buffer just like information
171 group specifier. 186 from any other group specifier.
172
173 Text between %( and %) will be highlighted with `gnus-mouse-face' when
174 the mouse point move inside the area. There can only be one such area.
175 187
176 Note that this format specification is not always respected. For 188 Note that this format specification is not always respected. For
177 reasons of efficiency, when listing killed groups, this specification 189 reasons of efficiency, when listing killed groups, this specification
178 is ignored altogether. If the spec is changed considerably, your 190 is ignored altogether. If the spec is changed considerably, your
179 output may end up looking strange when listing both alive and killed 191 output may end up looking strange when listing both alive and killed
181 193
182 If you use %o or %O, reading the active file will be slower and quite 194 If you use %o or %O, reading the active file will be slower and quite
183 a bit of extra memory will be used. %D will also worsen performance. 195 a bit of extra memory will be used. %D will also worsen performance.
184 Also note that if you change the format specification to include any 196 Also note that if you change the format specification to include any
185 of these specs, you must probably re-start Gnus to see them go into 197 of these specs, you must probably re-start Gnus to see them go into
186 effect." 198 effect.
199
200 General format specifiers can also be used.
201 See Info node `(gnus)Formatting Variables'."
202 :link '(custom-manual "(gnus)Formatting Variables")
187 :group 'gnus-group-visual 203 :group 'gnus-group-visual
188 :type 'string) 204 :type 'string)
189 205
190 (defcustom gnus-group-mode-line-format "Gnus: %%b {%M\%:%S}" 206 (defcustom gnus-group-mode-line-format "Gnus: %%b {%M\%:%S}"
191 "*The format specification for the group mode line. 207 "*The format specification for the group mode line.
196 %M The native select method. 212 %M The native select method.
197 %: \":\" if %S isn't \"\"." 213 %: \":\" if %S isn't \"\"."
198 :group 'gnus-group-visual 214 :group 'gnus-group-visual
199 :type 'string) 215 :type 'string)
200 216
201 (defcustom gnus-group-mode-hook nil 217 ;; Extracted from gnus-xmas-redefine in order to preserve user settings
202 "Hook for Gnus group mode." 218 (when (featurep 'xemacs)
203 :group 'gnus-group-various 219 (add-hook 'gnus-group-mode-hook 'gnus-xmas-group-menu-add)
204 :options '(gnus-topic-mode) 220 (add-hook 'gnus-group-mode-hook 'gnus-xmas-setup-group-toolbar))
205 :type 'hook)
206 221
207 (defcustom gnus-group-menu-hook nil 222 (defcustom gnus-group-menu-hook nil
208 "Hook run after the creation of the group mode menu." 223 "Hook run after the creation of the group mode menu."
209 :group 'gnus-group-various 224 :group 'gnus-group-various
210 :type 'hook) 225 :type 'hook)
286 :type '(repeat (list (string :tag "Description") 301 :type '(repeat (list (string :tag "Description")
287 (string :tag "Name") 302 (string :tag "Name")
288 (sexp :tag "Method")))) 303 (sexp :tag "Method"))))
289 304
290 (defcustom gnus-group-highlight 305 (defcustom gnus-group-highlight
291 '(;; News. 306 '(;; Mail.
292 ((and (= unread 0) (not mailp) (eq level 1)) . 307 ((and mailp (= unread 0) (eq level 1)) .
308 gnus-group-mail-1-empty-face)
309 ((and mailp (eq level 1)) .
310 gnus-group-mail-1-face)
311 ((and mailp (= unread 0) (eq level 2)) .
312 gnus-group-mail-2-empty-face)
313 ((and mailp (eq level 2)) .
314 gnus-group-mail-2-face)
315 ((and mailp (= unread 0) (eq level 3)) .
316 gnus-group-mail-3-empty-face)
317 ((and mailp (eq level 3)) .
318 gnus-group-mail-3-face)
319 ((and mailp (= unread 0)) .
320 gnus-group-mail-low-empty-face)
321 ((and mailp) .
322 gnus-group-mail-low-face)
323 ;; News.
324 ((and (= unread 0) (eq level 1)) .
293 gnus-group-news-1-empty-face) 325 gnus-group-news-1-empty-face)
294 ((and (not mailp) (eq level 1)) . 326 ((and (eq level 1)) .
295 gnus-group-news-1-face) 327 gnus-group-news-1-face)
296 ((and (= unread 0) (not mailp) (eq level 2)) . 328 ((and (= unread 0) (eq level 2)) .
297 gnus-group-news-2-empty-face) 329 gnus-group-news-2-empty-face)
298 ((and (not mailp) (eq level 2)) . 330 ((and (eq level 2)) .
299 gnus-group-news-2-face) 331 gnus-group-news-2-face)
300 ((and (= unread 0) (not mailp) (eq level 3)) . 332 ((and (= unread 0) (eq level 3)) .
301 gnus-group-news-3-empty-face) 333 gnus-group-news-3-empty-face)
302 ((and (not mailp) (eq level 3)) . 334 ((and (eq level 3)) .
303 gnus-group-news-3-face) 335 gnus-group-news-3-face)
304 ((and (= unread 0) (not mailp) (eq level 4)) . 336 ((and (= unread 0) (eq level 4)) .
305 gnus-group-news-4-empty-face) 337 gnus-group-news-4-empty-face)
306 ((and (not mailp) (eq level 4)) . 338 ((and (eq level 4)) .
307 gnus-group-news-4-face) 339 gnus-group-news-4-face)
308 ((and (= unread 0) (not mailp) (eq level 5)) . 340 ((and (= unread 0) (eq level 5)) .
309 gnus-group-news-5-empty-face) 341 gnus-group-news-5-empty-face)
310 ((and (not mailp) (eq level 5)) . 342 ((and (eq level 5)) .
311 gnus-group-news-5-face) 343 gnus-group-news-5-face)
312 ((and (= unread 0) (not mailp) (eq level 6)) . 344 ((and (= unread 0) (eq level 6)) .
313 gnus-group-news-6-empty-face) 345 gnus-group-news-6-empty-face)
314 ((and (not mailp) (eq level 6)) . 346 ((and (eq level 6)) .
315 gnus-group-news-6-face) 347 gnus-group-news-6-face)
316 ((and (= unread 0) (not mailp)) . 348 ((and (= unread 0)) .
317 gnus-group-news-low-empty-face) 349 gnus-group-news-low-empty-face)
318 ((and (not mailp)) .
319 gnus-group-news-low-face)
320 ;; Mail.
321 ((and (= unread 0) (eq level 1)) .
322 gnus-group-mail-1-empty-face)
323 ((eq level 1) .
324 gnus-group-mail-1-face)
325 ((and (= unread 0) (eq level 2)) .
326 gnus-group-mail-2-empty-face)
327 ((eq level 2) .
328 gnus-group-mail-2-face)
329 ((and (= unread 0) (eq level 3)) .
330 gnus-group-mail-3-empty-face)
331 ((eq level 3) .
332 gnus-group-mail-3-face)
333 ((= unread 0) .
334 gnus-group-mail-low-empty-face)
335 (t . 350 (t .
336 gnus-group-mail-low-face)) 351 gnus-group-news-low-face))
337 "*Controls the highlighting of group buffer lines. 352 "*Controls the highlighting of group buffer lines.
338 353
339 Below is a list of `Form'/`Face' pairs. When deciding how a a 354 Below is a list of `Form'/`Face' pairs. When deciding how a a
340 particular group line should be displayed, each form is 355 particular group line should be displayed, each form is
341 evaluated. The content of the face field after the first true form is 356 evaluated. The content of the face field after the first true form is
393 ticked: The number of ticked articles." 408 ticked: The number of ticked articles."
394 :group 'gnus-group-icons 409 :group 'gnus-group-icons
395 :type '(repeat (cons (sexp :tag "Form") file))) 410 :type '(repeat (cons (sexp :tag "Form") file)))
396 411
397 (defcustom gnus-group-name-charset-method-alist nil 412 (defcustom gnus-group-name-charset-method-alist nil
398 "*Alist of method and the charset for group names. 413 "Alist of method and the charset for group names.
399 414
400 For example: 415 For example:
401 (((nntp \"news.com.cn\") . cn-gb-2312)) 416 (((nntp \"news.com.cn\") . cn-gb-2312))"
402 "
403 :version "21.1" 417 :version "21.1"
404 :group 'gnus-charset 418 :group 'gnus-charset
405 :type '(repeat (cons (sexp :tag "Method") (symbol :tag "Charset")))) 419 :type '(repeat (cons (sexp :tag "Method") (symbol :tag "Charset"))))
406 420
407 (defcustom gnus-group-name-charset-group-alist nil 421 (defcustom gnus-group-name-charset-group-alist
408 "*Alist of group regexp and the charset for group names. 422 (if (or (and (fboundp 'find-coding-system) (find-coding-system 'utf-8))
423 (mm-coding-system-p 'utf-8))
424 '((".*" . utf-8))
425 nil)
426 "Alist of group regexp and the charset for group names.
409 427
410 For example: 428 For example:
411 ((\"\\.com\\.cn:\" . cn-gb-2312)) 429 ((\"\\.com\\.cn:\" . cn-gb-2312))"
412 "
413 :group 'gnus-charset 430 :group 'gnus-charset
414 :type '(repeat (cons (regexp :tag "Group") (symbol :tag "Charset")))) 431 :type '(repeat (cons (regexp :tag "Group") (symbol :tag "Charset"))))
415 432
433 (defcustom gnus-group-jump-to-group-prompt nil
434 "Default prompt for `gnus-group-jump-to-group'.
435 If non-nil, the value should be a string, e.g. \"nnml:\",
436 in which case `gnus-group-jump-to-group' offers \"Group: nnml:\"
437 in the minibuffer prompt."
438 :group 'gnus-group-various
439 :type '(choice (string :tag "Prompt string")
440 (const :tag "Empty" nil)))
441
442 (defvar gnus-group-listing-limit 1000
443 "*A limit of the number of groups when listing.
444 If the number of groups is larger than the limit, list them in a
445 simple manner.")
446
416 ;;; Internal variables 447 ;;; Internal variables
417 448
449 (defvar gnus-group-is-exiting-p nil)
450 (defvar gnus-group-is-exiting-without-update-p nil)
418 (defvar gnus-group-sort-alist-function 'gnus-group-sort-flat 451 (defvar gnus-group-sort-alist-function 'gnus-group-sort-flat
419 "Function for sorting the group buffer.") 452 "Function for sorting the group buffer.")
420 453
421 (defvar gnus-group-sort-selected-function 'gnus-group-sort-selected-flat 454 (defvar gnus-group-sort-selected-function 'gnus-group-sort-selected-flat
422 "Function for sorting the selected groups in the group buffer.") 455 "Function for sorting the selected groups in the group buffer.")
439 (+ number 472 (+ number
440 (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked))) 473 (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked)))
441 (gnus-range-length (cdr (assq 'tick gnus-tmp-marked)))))) 474 (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))))))
442 (t number)) ?s) 475 (t number)) ?s)
443 (?R gnus-tmp-number-of-read ?s) 476 (?R gnus-tmp-number-of-read ?s)
477 (?U (gnus-number-of-unseen-articles-in-group gnus-tmp-group) ?d)
444 (?t gnus-tmp-number-total ?d) 478 (?t gnus-tmp-number-total ?d)
445 (?y gnus-tmp-number-of-unread ?s) 479 (?y gnus-tmp-number-of-unread ?s)
446 (?I (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked))) ?d) 480 (?I (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked))) ?d)
447 (?T (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))) ?d) 481 (?T (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))) ?d)
448 (?i (+ (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked))) 482 (?i (+ (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked)))
449 (gnus-range-length (cdr (assq 'tick gnus-tmp-marked)))) ?d) 483 (gnus-range-length (cdr (assq 'tick gnus-tmp-marked)))) ?d)
450 (?g gnus-tmp-group ?s) 484 (?g gnus-tmp-group ?s)
451 (?G gnus-tmp-qualified-group ?s) 485 (?G gnus-tmp-qualified-group ?s)
452 (?c (gnus-short-group-name gnus-tmp-group) ?s) 486 (?c (gnus-short-group-name gnus-tmp-group) ?s)
487 (?C gnus-tmp-comment ?s)
453 (?D gnus-tmp-newsgroup-description ?s) 488 (?D gnus-tmp-newsgroup-description ?s)
454 (?o gnus-tmp-moderated ?c) 489 (?o gnus-tmp-moderated ?c)
455 (?O gnus-tmp-moderated-string ?s) 490 (?O gnus-tmp-moderated-string ?s)
456 (?p gnus-tmp-process-marked ?c) 491 (?p gnus-tmp-process-marked ?c)
457 (?s gnus-tmp-news-server ?s) 492 (?s gnus-tmp-news-server ?s)
458 (?n gnus-tmp-news-method ?s) 493 (?n gnus-tmp-news-method ?s)
459 (?P gnus-group-indentation ?s) 494 (?P gnus-group-indentation ?s)
460 (?E gnus-tmp-group-icon ?s) 495 (?E gnus-tmp-group-icon ?s)
496 (?B gnus-tmp-summary-live ?c)
461 (?l gnus-tmp-grouplens ?s) 497 (?l gnus-tmp-grouplens ?s)
462 (?z gnus-tmp-news-method-string ?s) 498 (?z gnus-tmp-news-method-string ?s)
463 (?m (gnus-group-new-mail gnus-tmp-group) ?c) 499 (?m (gnus-group-new-mail gnus-tmp-group) ?c)
464 (?d (gnus-group-timestamp-string gnus-tmp-group) ?s) 500 (?d (gnus-group-timestamp-string gnus-tmp-group) ?s)
465 (?u gnus-tmp-user-defined ?s))) 501 (?u gnus-tmp-user-defined ?s)))
481 (defvar gnus-group-list-mode nil) 517 (defvar gnus-group-list-mode nil)
482 518
483 519
484 (defvar gnus-group-icon-cache nil) 520 (defvar gnus-group-icon-cache nil)
485 521
522 (defvar gnus-group-listed-groups nil)
523 (defvar gnus-group-list-option nil)
524
486 ;;; 525 ;;;
487 ;;; Gnus group mode 526 ;;; Gnus group mode
488 ;;; 527 ;;;
489 528
490 (put 'gnus-group-mode 'mode-class 'special) 529 (put 'gnus-group-mode 'mode-class 'special)
491 530
492 (when t 531 (gnus-define-keys gnus-group-mode-map
493 (gnus-define-keys gnus-group-mode-map 532 " " gnus-group-read-group
494 " " gnus-group-read-group 533 "=" gnus-group-select-group
495 "=" gnus-group-select-group 534 "\r" gnus-group-select-group
496 "\r" gnus-group-select-group 535 "\M-\r" gnus-group-quick-select-group
497 "\M-\r" gnus-group-quick-select-group 536 "\M- " gnus-group-visible-select-group
498 "\M- " gnus-group-visible-select-group 537 [(meta control return)] gnus-group-select-group-ephemerally
499 [(meta control return)] gnus-group-select-group-ephemerally 538 "j" gnus-group-jump-to-group
500 "j" gnus-group-jump-to-group 539 "n" gnus-group-next-unread-group
501 "n" gnus-group-next-unread-group 540 "p" gnus-group-prev-unread-group
502 "p" gnus-group-prev-unread-group 541 "\177" gnus-group-prev-unread-group
503 "\177" gnus-group-prev-unread-group 542 [delete] gnus-group-prev-unread-group
504 [delete] gnus-group-prev-unread-group 543 [backspace] gnus-group-prev-unread-group
505 [backspace] gnus-group-prev-unread-group 544 "N" gnus-group-next-group
506 "N" gnus-group-next-group 545 "P" gnus-group-prev-group
507 "P" gnus-group-prev-group 546 "\M-n" gnus-group-next-unread-group-same-level
508 "\M-n" gnus-group-next-unread-group-same-level 547 "\M-p" gnus-group-prev-unread-group-same-level
509 "\M-p" gnus-group-prev-unread-group-same-level 548 "," gnus-group-best-unread-group
510 "," gnus-group-best-unread-group 549 "." gnus-group-first-unread-group
511 "." gnus-group-first-unread-group 550 "u" gnus-group-unsubscribe-current-group
512 "u" gnus-group-unsubscribe-current-group 551 "U" gnus-group-unsubscribe-group
513 "U" gnus-group-unsubscribe-group 552 "c" gnus-group-catchup-current
514 "c" gnus-group-catchup-current 553 "C" gnus-group-catchup-current-all
515 "C" gnus-group-catchup-current-all 554 "\M-c" gnus-group-clear-data
516 "\M-c" gnus-group-clear-data 555 "l" gnus-group-list-groups
517 "l" gnus-group-list-groups 556 "L" gnus-group-list-all-groups
518 "L" gnus-group-list-all-groups 557 "m" gnus-group-mail
519 "m" gnus-group-mail 558 "i" gnus-group-news
520 "g" gnus-group-get-new-news 559 "g" gnus-group-get-new-news
521 "\M-g" gnus-group-get-new-news-this-group 560 "\M-g" gnus-group-get-new-news-this-group
522 "R" gnus-group-restart 561 "R" gnus-group-restart
523 "r" gnus-group-read-init-file 562 "r" gnus-group-read-init-file
524 "B" gnus-group-browse-foreign-server 563 "B" gnus-group-browse-foreign-server
525 "b" gnus-group-check-bogus-groups 564 "b" gnus-group-check-bogus-groups
526 "F" gnus-group-find-new-groups 565 "F" gnus-group-find-new-groups
527 "\C-c\C-d" gnus-group-describe-group 566 "\C-c\C-d" gnus-group-describe-group
528 "\M-d" gnus-group-describe-all-groups 567 "\M-d" gnus-group-describe-all-groups
529 "\C-c\C-a" gnus-group-apropos 568 "\C-c\C-a" gnus-group-apropos
530 "\C-c\M-\C-a" gnus-group-description-apropos 569 "\C-c\M-\C-a" gnus-group-description-apropos
531 "a" gnus-group-post-news 570 "a" gnus-group-post-news
532 "\ek" gnus-group-edit-local-kill 571 "\ek" gnus-group-edit-local-kill
533 "\eK" gnus-group-edit-global-kill 572 "\eK" gnus-group-edit-global-kill
534 "\C-k" gnus-group-kill-group 573 "\C-k" gnus-group-kill-group
535 "\C-y" gnus-group-yank-group 574 "\C-y" gnus-group-yank-group
536 "\C-w" gnus-group-kill-region 575 "\C-w" gnus-group-kill-region
537 "\C-x\C-t" gnus-group-transpose-groups 576 "\C-x\C-t" gnus-group-transpose-groups
538 "\C-c\C-l" gnus-group-list-killed 577 "\C-c\C-l" gnus-group-list-killed
539 "\C-c\C-x" gnus-group-expire-articles 578 "\C-c\C-x" gnus-group-expire-articles
540 "\C-c\M-\C-x" gnus-group-expire-all-groups 579 "\C-c\M-\C-x" gnus-group-expire-all-groups
541 "V" gnus-version 580 "V" gnus-version
542 "s" gnus-group-save-newsrc 581 "s" gnus-group-save-newsrc
543 "z" gnus-group-suspend 582 "z" gnus-group-suspend
544 "q" gnus-group-exit 583 "q" gnus-group-exit
545 "Q" gnus-group-quit 584 "Q" gnus-group-quit
546 "?" gnus-group-describe-briefly 585 "?" gnus-group-describe-briefly
547 "\C-c\C-i" gnus-info-find-node 586 "\C-c\C-i" gnus-info-find-node
548 "\M-e" gnus-group-edit-group-method 587 "\M-e" gnus-group-edit-group-method
549 "^" gnus-group-enter-server-mode 588 "^" gnus-group-enter-server-mode
550 gnus-mouse-2 gnus-mouse-pick-group 589 gnus-mouse-2 gnus-mouse-pick-group
551 "<" beginning-of-buffer 590 "<" beginning-of-buffer
552 ">" end-of-buffer 591 ">" end-of-buffer
553 "\C-c\C-b" gnus-bug 592 "\C-c\C-b" gnus-bug
554 "\C-c\C-s" gnus-group-sort-groups 593 "\C-c\C-s" gnus-group-sort-groups
555 "t" gnus-topic-mode 594 "t" gnus-topic-mode
556 "\C-c\M-g" gnus-activate-all-groups 595 "\C-c\M-g" gnus-activate-all-groups
557 "\M-&" gnus-group-universal-argument 596 "\M-&" gnus-group-universal-argument
558 "#" gnus-group-mark-group 597 "#" gnus-group-mark-group
559 "\M-#" gnus-group-unmark-group) 598 "\M-#" gnus-group-unmark-group)
560 599
561 (gnus-define-keys (gnus-group-mark-map "M" gnus-group-mode-map) 600 (gnus-define-keys (gnus-group-mark-map "M" gnus-group-mode-map)
562 "m" gnus-group-mark-group 601 "m" gnus-group-mark-group
563 "u" gnus-group-unmark-group 602 "u" gnus-group-unmark-group
564 "w" gnus-group-mark-region 603 "w" gnus-group-mark-region
565 "b" gnus-group-mark-buffer 604 "b" gnus-group-mark-buffer
566 "r" gnus-group-mark-regexp 605 "r" gnus-group-mark-regexp
567 "U" gnus-group-unmark-all-groups) 606 "U" gnus-group-unmark-all-groups)
568 607
569 (gnus-define-keys (gnus-group-group-map "G" gnus-group-mode-map) 608 (gnus-define-keys (gnus-group-sieve-map "D" gnus-group-mode-map)
570 "d" gnus-group-make-directory-group 609 "u" gnus-sieve-update
571 "h" gnus-group-make-help-group 610 "g" gnus-sieve-generate)
572 "u" gnus-group-make-useful-group 611
573 "a" gnus-group-make-archive-group 612 (gnus-define-keys (gnus-group-group-map "G" gnus-group-mode-map)
574 "k" gnus-group-make-kiboze-group 613 "d" gnus-group-make-directory-group
575 "l" gnus-group-nnimap-edit-acl 614 "h" gnus-group-make-help-group
576 "m" gnus-group-make-group 615 "u" gnus-group-make-useful-group
577 "E" gnus-group-edit-group 616 "a" gnus-group-make-archive-group
578 "e" gnus-group-edit-group-method 617 "k" gnus-group-make-kiboze-group
579 "p" gnus-group-edit-group-parameters 618 "l" gnus-group-nnimap-edit-acl
580 "v" gnus-group-add-to-virtual 619 "m" gnus-group-make-group
581 "V" gnus-group-make-empty-virtual 620 "E" gnus-group-edit-group
582 "D" gnus-group-enter-directory 621 "e" gnus-group-edit-group-method
583 "f" gnus-group-make-doc-group 622 "p" gnus-group-edit-group-parameters
584 "w" gnus-group-make-web-group 623 "v" gnus-group-add-to-virtual
585 "r" gnus-group-rename-group 624 "V" gnus-group-make-empty-virtual
586 "c" gnus-group-customize 625 "D" gnus-group-enter-directory
587 "x" gnus-group-nnimap-expunge 626 "f" gnus-group-make-doc-group
588 "\177" gnus-group-delete-group 627 "w" gnus-group-make-web-group
589 [delete] gnus-group-delete-group) 628 "M" gnus-group-read-ephemeral-group
590 629 "r" gnus-group-rename-group
591 (gnus-define-keys (gnus-group-soup-map "s" gnus-group-group-map) 630 "R" gnus-group-make-rss-group
592 "b" gnus-group-brew-soup 631 "c" gnus-group-customize
593 "w" gnus-soup-save-areas 632 "x" gnus-group-nnimap-expunge
594 "s" gnus-soup-send-replies 633 "\177" gnus-group-delete-group
595 "p" gnus-soup-pack-packet 634 [delete] gnus-group-delete-group)
596 "r" nnsoup-pack-replies) 635
597 636 (gnus-define-keys (gnus-group-soup-map "s" gnus-group-group-map)
598 (gnus-define-keys (gnus-group-sort-map "S" gnus-group-group-map) 637 "b" gnus-group-brew-soup
599 "s" gnus-group-sort-groups 638 "w" gnus-soup-save-areas
600 "a" gnus-group-sort-groups-by-alphabet 639 "s" gnus-soup-send-replies
601 "u" gnus-group-sort-groups-by-unread 640 "p" gnus-soup-pack-packet
602 "l" gnus-group-sort-groups-by-level 641 "r" nnsoup-pack-replies)
603 "v" gnus-group-sort-groups-by-score 642
604 "r" gnus-group-sort-groups-by-rank 643 (gnus-define-keys (gnus-group-sort-map "S" gnus-group-group-map)
605 "m" gnus-group-sort-groups-by-method) 644 "s" gnus-group-sort-groups
606 645 "a" gnus-group-sort-groups-by-alphabet
607 (gnus-define-keys (gnus-group-sort-selected-map "P" gnus-group-group-map) 646 "u" gnus-group-sort-groups-by-unread
608 "s" gnus-group-sort-selected-groups 647 "l" gnus-group-sort-groups-by-level
609 "a" gnus-group-sort-selected-groups-by-alphabet 648 "v" gnus-group-sort-groups-by-score
610 "u" gnus-group-sort-selected-groups-by-unread 649 "r" gnus-group-sort-groups-by-rank
611 "l" gnus-group-sort-selected-groups-by-level 650 "m" gnus-group-sort-groups-by-method
612 "v" gnus-group-sort-selected-groups-by-score 651 "n" gnus-group-sort-groups-by-real-name)
613 "r" gnus-group-sort-selected-groups-by-rank 652
614 "m" gnus-group-sort-selected-groups-by-method) 653 (gnus-define-keys (gnus-group-sort-selected-map "P" gnus-group-group-map)
615 654 "s" gnus-group-sort-selected-groups
616 (gnus-define-keys (gnus-group-list-map "A" gnus-group-mode-map) 655 "a" gnus-group-sort-selected-groups-by-alphabet
617 "k" gnus-group-list-killed 656 "u" gnus-group-sort-selected-groups-by-unread
618 "z" gnus-group-list-zombies 657 "l" gnus-group-sort-selected-groups-by-level
619 "s" gnus-group-list-groups 658 "v" gnus-group-sort-selected-groups-by-score
620 "u" gnus-group-list-all-groups 659 "r" gnus-group-sort-selected-groups-by-rank
621 "A" gnus-group-list-active 660 "m" gnus-group-sort-selected-groups-by-method
622 "a" gnus-group-apropos 661 "n" gnus-group-sort-selected-groups-by-real-name)
623 "d" gnus-group-description-apropos 662
624 "m" gnus-group-list-matching 663 (gnus-define-keys (gnus-group-list-map "A" gnus-group-mode-map)
625 "M" gnus-group-list-all-matching 664 "k" gnus-group-list-killed
626 "l" gnus-group-list-level 665 "z" gnus-group-list-zombies
627 "c" gnus-group-list-cached 666 "s" gnus-group-list-groups
628 "?" gnus-group-list-dormant) 667 "u" gnus-group-list-all-groups
629 668 "A" gnus-group-list-active
630 (gnus-define-keys (gnus-group-score-map "W" gnus-group-mode-map) 669 "a" gnus-group-apropos
631 "f" gnus-score-flush-cache) 670 "d" gnus-group-description-apropos
632 671 "m" gnus-group-list-matching
633 (gnus-define-keys (gnus-group-help-map "H" gnus-group-mode-map) 672 "M" gnus-group-list-all-matching
634 "d" gnus-group-describe-group 673 "l" gnus-group-list-level
635 "f" gnus-group-fetch-faq 674 "c" gnus-group-list-cached
636 "v" gnus-version) 675 "?" gnus-group-list-dormant)
637 676
638 (gnus-define-keys (gnus-group-sub-map "S" gnus-group-mode-map) 677 (gnus-define-keys (gnus-group-list-limit-map "/" gnus-group-list-map)
639 "l" gnus-group-set-current-level 678 "k" gnus-group-list-limit
640 "t" gnus-group-unsubscribe-current-group 679 "z" gnus-group-list-limit
641 "s" gnus-group-unsubscribe-group 680 "s" gnus-group-list-limit
642 "k" gnus-group-kill-group 681 "u" gnus-group-list-limit
643 "y" gnus-group-yank-group 682 "A" gnus-group-list-limit
644 "w" gnus-group-kill-region 683 "m" gnus-group-list-limit
645 "\C-k" gnus-group-kill-level 684 "M" gnus-group-list-limit
646 "z" gnus-group-kill-all-zombies)) 685 "l" gnus-group-list-limit
686 "c" gnus-group-list-limit
687 "?" gnus-group-list-limit)
688
689 (gnus-define-keys (gnus-group-list-flush-map "f" gnus-group-list-map)
690 "k" gnus-group-list-flush
691 "z" gnus-group-list-flush
692 "s" gnus-group-list-flush
693 "u" gnus-group-list-flush
694 "A" gnus-group-list-flush
695 "m" gnus-group-list-flush
696 "M" gnus-group-list-flush
697 "l" gnus-group-list-flush
698 "c" gnus-group-list-flush
699 "?" gnus-group-list-flush)
700
701 (gnus-define-keys (gnus-group-list-plus-map "p" gnus-group-list-map)
702 "k" gnus-group-list-plus
703 "z" gnus-group-list-plus
704 "s" gnus-group-list-plus
705 "u" gnus-group-list-plus
706 "A" gnus-group-list-plus
707 "m" gnus-group-list-plus
708 "M" gnus-group-list-plus
709 "l" gnus-group-list-plus
710 "c" gnus-group-list-plus
711 "?" gnus-group-list-plus)
712
713 (gnus-define-keys (gnus-group-score-map "W" gnus-group-mode-map)
714 "f" gnus-score-flush-cache)
715
716 (gnus-define-keys (gnus-group-help-map "H" gnus-group-mode-map)
717 "c" gnus-group-fetch-charter
718 "C" gnus-group-fetch-control
719 "d" gnus-group-describe-group
720 "f" gnus-group-fetch-faq
721 "v" gnus-version)
722
723 (gnus-define-keys (gnus-group-sub-map "S" gnus-group-mode-map)
724 "l" gnus-group-set-current-level
725 "t" gnus-group-unsubscribe-current-group
726 "s" gnus-group-unsubscribe-group
727 "k" gnus-group-kill-group
728 "y" gnus-group-yank-group
729 "w" gnus-group-kill-region
730 "\C-k" gnus-group-kill-level
731 "z" gnus-group-kill-all-zombies)
732
733 (defun gnus-topic-mode-p ()
734 "Return non-nil in `gnus-topic-mode'."
735 (and (boundp 'gnus-topic-mode)
736 (symbol-value 'gnus-topic-mode)))
647 737
648 (defun gnus-group-make-menu-bar () 738 (defun gnus-group-make-menu-bar ()
649 (gnus-turn-off-edit-menu 'group) 739 (gnus-turn-off-edit-menu 'group)
650 (unless (boundp 'gnus-group-reading-menu) 740 (unless (boundp 'gnus-group-reading-menu)
651 741
652 (easy-menu-define 742 (easy-menu-define
653 gnus-group-reading-menu gnus-group-mode-map "" 743 gnus-group-reading-menu gnus-group-mode-map ""
654 '("Group" 744 `("Group"
655 ["Read" gnus-group-read-group (gnus-group-group-name)] 745 ["Read" gnus-group-read-group
656 ["Select" gnus-group-select-group (gnus-group-group-name)] 746 :included (not (gnus-topic-mode-p))
747 :active (gnus-group-group-name)]
748 ["Read " gnus-topic-read-group
749 :included (gnus-topic-mode-p)]
750 ["Select" gnus-group-select-group
751 :included (not (gnus-topic-mode-p))
752 :active (gnus-group-group-name)]
753 ["Select " gnus-topic-select-group
754 :included (gnus-topic-mode-p)]
657 ["See old articles" (gnus-group-select-group 'all) 755 ["See old articles" (gnus-group-select-group 'all)
658 :keys "C-u SPC" :active (gnus-group-group-name)] 756 :keys "C-u SPC" :active (gnus-group-group-name)]
659 ["Catch up" gnus-group-catchup-current :active (gnus-group-group-name) 757 ["Catch up" gnus-group-catchup-current
660 :help "Mark unread articles in the current group as read"] 758 :included (not (gnus-topic-mode-p))
759 :active (gnus-group-group-name)
760 ,@(if (featurep 'xemacs) nil
761 '(:help "Mark unread articles in the current group as read"))]
762 ["Catch up " gnus-topic-catchup-articles
763 :included (gnus-topic-mode-p)
764 ,@(if (featurep 'xemacs) nil
765 '(:help "Mark unread articles in the current group or topic as read"))]
661 ["Catch up all articles" gnus-group-catchup-current-all 766 ["Catch up all articles" gnus-group-catchup-current-all
662 (gnus-group-group-name)] 767 (gnus-group-group-name)]
663 ["Check for new articles" gnus-group-get-new-news-this-group 768 ["Check for new articles" gnus-group-get-new-news-this-group
769 :included (not (gnus-topic-mode-p))
664 :active (gnus-group-group-name) 770 :active (gnus-group-group-name)
665 :help "Check for new messages in current group"] 771 ,@(if (featurep 'xemacs) nil
772 '(:help "Check for new messages in current group"))]
773 ["Check for new articles " gnus-topic-get-new-news-this-topic
774 :included (gnus-topic-mode-p)
775 ,@(if (featurep 'xemacs) nil
776 '(:help "Check for new messages in current group or topic"))]
666 ["Toggle subscription" gnus-group-unsubscribe-current-group 777 ["Toggle subscription" gnus-group-unsubscribe-current-group
667 (gnus-group-group-name)] 778 (gnus-group-group-name)]
668 ["Kill" gnus-group-kill-group :active (gnus-group-group-name) 779 ["Kill" gnus-group-kill-group :active (gnus-group-group-name)
669 :help "Kill (remove) current group"] 780 ,@(if (featurep 'xemacs) nil
781 '(:help "Kill (remove) current group"))]
670 ["Yank" gnus-group-yank-group gnus-list-of-killed-groups] 782 ["Yank" gnus-group-yank-group gnus-list-of-killed-groups]
671 ["Describe" gnus-group-describe-group :active (gnus-group-group-name) 783 ["Describe" gnus-group-describe-group :active (gnus-group-group-name)
672 :help "Display description of the current group"] 784 ,@(if (featurep 'xemacs) nil
785 '(:help "Display description of the current group"))]
673 ["Fetch FAQ" gnus-group-fetch-faq (gnus-group-group-name)] 786 ["Fetch FAQ" gnus-group-fetch-faq (gnus-group-group-name)]
787 ["Fetch charter" gnus-group-fetch-charter
788 :active (gnus-group-group-name)
789 ,@(if (featurep 'xemacs) nil
790 '(:help "Display the charter of the current group"))]
791 ["Fetch control message" gnus-group-fetch-control
792 :active (gnus-group-group-name)
793 ,@(if (featurep 'xemacs) nil
794 '(:help "Display the archived control message for the current group"))]
674 ;; Actually one should check, if any of the marked groups gives t for 795 ;; Actually one should check, if any of the marked groups gives t for
675 ;; (gnus-check-backend-function 'request-expire-articles ...) 796 ;; (gnus-check-backend-function 'request-expire-articles ...)
676 ["Expire articles" gnus-group-expire-articles 797 ["Expire articles" gnus-group-expire-articles
677 (or (and (gnus-group-group-name) 798 :included (not (gnus-topic-mode-p))
678 (gnus-check-backend-function 799 :active (or (and (gnus-group-group-name)
679 'request-expire-articles 800 (gnus-check-backend-function
680 (gnus-group-group-name))) gnus-group-marked)] 801 'request-expire-articles
681 ["Set group level" gnus-group-set-current-level 802 (gnus-group-group-name))) gnus-group-marked)]
803 ["Expire articles " gnus-topic-expire-articles
804 :included (gnus-topic-mode-p)]
805 ["Set group level..." gnus-group-set-current-level
682 (gnus-group-group-name)] 806 (gnus-group-group-name)]
683 ["Select quick" gnus-group-quick-select-group (gnus-group-group-name)] 807 ["Select quick" gnus-group-quick-select-group (gnus-group-group-name)]
684 ["Customize" gnus-group-customize (gnus-group-group-name)] 808 ["Customize" gnus-group-customize (gnus-group-group-name)]
685 ("Edit" 809 ("Edit"
686 ["Parameters" gnus-group-edit-group-parameters 810 ["Parameters" gnus-group-edit-group-parameters
687 (gnus-group-group-name)] 811 :included (not (gnus-topic-mode-p))
812 :active (gnus-group-group-name)]
813 ["Parameters " gnus-topic-edit-parameters
814 :included (gnus-topic-mode-p)]
688 ["Select method" gnus-group-edit-group-method 815 ["Select method" gnus-group-edit-group-method
689 (gnus-group-group-name)] 816 (gnus-group-group-name)]
690 ["Info" gnus-group-edit-group (gnus-group-group-name)] 817 ["Info" gnus-group-edit-group (gnus-group-group-name)]
691 ["Local kill file" gnus-group-edit-local-kill (gnus-group-group-name)] 818 ["Local kill file" gnus-group-edit-local-kill (gnus-group-group-name)]
692 ["Global kill file" gnus-group-edit-global-kill t]))) 819 ["Global kill file" gnus-group-edit-global-kill t])))
713 ["Sort by method" gnus-group-sort-groups-by-method t] 840 ["Sort by method" gnus-group-sort-groups-by-method t]
714 ["Sort by rank" gnus-group-sort-groups-by-rank t] 841 ["Sort by rank" gnus-group-sort-groups-by-rank t]
715 ["Sort by score" gnus-group-sort-groups-by-score t] 842 ["Sort by score" gnus-group-sort-groups-by-score t]
716 ["Sort by level" gnus-group-sort-groups-by-level t] 843 ["Sort by level" gnus-group-sort-groups-by-level t]
717 ["Sort by unread" gnus-group-sort-groups-by-unread t] 844 ["Sort by unread" gnus-group-sort-groups-by-unread t]
718 ["Sort by name" gnus-group-sort-groups-by-alphabet t]) 845 ["Sort by name" gnus-group-sort-groups-by-alphabet t]
846 ["Sort by real name" gnus-group-sort-groups-by-real-name t])
719 ("Sort process/prefixed" 847 ("Sort process/prefixed"
720 ["Default sort" gnus-group-sort-selected-groups 848 ["Default sort" gnus-group-sort-selected-groups
721 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))] 849 (not (gnus-topic-mode-p))]
722 ["Sort by method" gnus-group-sort-selected-groups-by-method 850 ["Sort by method" gnus-group-sort-selected-groups-by-method
723 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))] 851 (not (gnus-topic-mode-p))]
724 ["Sort by rank" gnus-group-sort-selected-groups-by-rank 852 ["Sort by rank" gnus-group-sort-selected-groups-by-rank
725 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))] 853 (not (gnus-topic-mode-p))]
726 ["Sort by score" gnus-group-sort-selected-groups-by-score 854 ["Sort by score" gnus-group-sort-selected-groups-by-score
727 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))] 855 (not (gnus-topic-mode-p))]
728 ["Sort by level" gnus-group-sort-selected-groups-by-level 856 ["Sort by level" gnus-group-sort-selected-groups-by-level
729 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))] 857 (not (gnus-topic-mode-p))]
730 ["Sort by unread" gnus-group-sort-selected-groups-by-unread 858 ["Sort by unread" gnus-group-sort-selected-groups-by-unread
731 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))] 859 (not (gnus-topic-mode-p))]
732 ["Sort by name" gnus-group-sort-selected-groups-by-alphabet 860 ["Sort by name" gnus-group-sort-selected-groups-by-alphabet
733 (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))]) 861 (not (gnus-topic-mode-p))]
862 ["Sort by real name" gnus-group-sort-selected-groups-by-real-name
863 (not (gnus-topic-mode-p))])
734 ("Mark" 864 ("Mark"
735 ["Mark group" gnus-group-mark-group 865 ["Mark group" gnus-group-mark-group
736 (and (gnus-group-group-name) 866 (and (gnus-group-group-name)
737 (not (memq (gnus-group-group-name) gnus-group-marked)))] 867 (not (memq (gnus-group-group-name) gnus-group-marked)))]
738 ["Unmark group" gnus-group-unmark-group 868 ["Unmark group" gnus-group-unmark-group
739 (and (gnus-group-group-name) 869 (and (gnus-group-group-name)
740 (memq (gnus-group-group-name) gnus-group-marked))] 870 (memq (gnus-group-group-name) gnus-group-marked))]
741 ["Unmark all" gnus-group-unmark-all-groups gnus-group-marked] 871 ["Unmark all" gnus-group-unmark-all-groups gnus-group-marked]
742 ["Mark regexp..." gnus-group-mark-regexp t] 872 ["Mark regexp..." gnus-group-mark-regexp t]
743 ["Mark region" gnus-group-mark-region t] 873 ["Mark region" gnus-group-mark-region :active (gnus-mark-active-p)]
744 ["Mark buffer" gnus-group-mark-buffer t] 874 ["Mark buffer" gnus-group-mark-buffer t]
745 ["Execute command" gnus-group-universal-argument 875 ["Execute command" gnus-group-universal-argument
746 (or gnus-group-marked (gnus-group-group-name))]) 876 (or gnus-group-marked (gnus-group-group-name))])
747 ("Subscribe" 877 ("Subscribe"
748 ["Subscribe to a group" gnus-group-unsubscribe-group t] 878 ["Subscribe to a group..." gnus-group-unsubscribe-group t]
749 ["Kill all newsgroups in region" gnus-group-kill-region t] 879 ["Kill all newsgroups in region" gnus-group-kill-region
880 :active (gnus-mark-active-p)]
750 ["Kill all zombie groups" gnus-group-kill-all-zombies 881 ["Kill all zombie groups" gnus-group-kill-all-zombies
751 gnus-zombie-list] 882 gnus-zombie-list]
752 ["Kill all groups on level..." gnus-group-kill-level t]) 883 ["Kill all groups on level..." gnus-group-kill-level t])
753 ("Foreign groups" 884 ("Foreign groups"
754 ["Make a foreign group" gnus-group-make-group t] 885 ["Make a foreign group..." gnus-group-make-group t]
755 ["Add a directory group" gnus-group-make-directory-group t] 886 ["Add a directory group..." gnus-group-make-directory-group t]
756 ["Add the help group" gnus-group-make-help-group t] 887 ["Add the help group" gnus-group-make-help-group t]
757 ["Add the archive group" gnus-group-make-archive-group t] 888 ["Add the archive group" gnus-group-make-archive-group t]
758 ["Make a doc group" gnus-group-make-doc-group t] 889 ["Make a doc group..." gnus-group-make-doc-group t]
759 ["Make a web group" gnus-group-make-web-group t] 890 ["Make a web group..." gnus-group-make-web-group t]
760 ["Make a kiboze group" gnus-group-make-kiboze-group t] 891 ["Make a kiboze group..." gnus-group-make-kiboze-group t]
761 ["Make a virtual group" gnus-group-make-empty-virtual t] 892 ["Make a virtual group..." gnus-group-make-empty-virtual t]
762 ["Add a group to a virtual" gnus-group-add-to-virtual t] 893 ["Add a group to a virtual..." gnus-group-add-to-virtual t]
763 ["Rename group" gnus-group-rename-group 894 ["Make an ephemeral group..." gnus-group-read-ephemeral-group t]
895 ["Make an RSS group..." gnus-group-make-rss-group t]
896 ["Rename group..." gnus-group-rename-group
764 (gnus-check-backend-function 897 (gnus-check-backend-function
765 'request-rename-group (gnus-group-group-name))] 898 'request-rename-group (gnus-group-group-name))]
766 ["Delete group" gnus-group-delete-group 899 ["Delete group" gnus-group-delete-group
767 (gnus-check-backend-function 900 (gnus-check-backend-function
768 'request-delete-group (gnus-group-group-name))]) 901 'request-delete-group (gnus-group-group-name))])
772 ["Next unread" gnus-group-next-unread-group t] 905 ["Next unread" gnus-group-next-unread-group t]
773 ["Previous unread" gnus-group-prev-unread-group t] 906 ["Previous unread" gnus-group-prev-unread-group t]
774 ["Next unread same level" gnus-group-next-unread-group-same-level t] 907 ["Next unread same level" gnus-group-next-unread-group-same-level t]
775 ["Previous unread same level" 908 ["Previous unread same level"
776 gnus-group-prev-unread-group-same-level t] 909 gnus-group-prev-unread-group-same-level t]
777 ["Jump to group" gnus-group-jump-to-group t] 910 ["Jump to group..." gnus-group-jump-to-group t]
778 ["First unread group" gnus-group-first-unread-group t] 911 ["First unread group" gnus-group-first-unread-group t]
779 ["Best unread group" gnus-group-best-unread-group t]) 912 ["Best unread group" gnus-group-best-unread-group t])
913 ("Sieve"
914 ["Generate" gnus-sieve-generate t]
915 ["Generate and update" gnus-sieve-update t])
780 ["Delete bogus groups" gnus-group-check-bogus-groups t] 916 ["Delete bogus groups" gnus-group-check-bogus-groups t]
781 ["Find new newsgroups" gnus-group-find-new-groups t] 917 ["Find new newsgroups" gnus-group-find-new-groups t]
782 ["Transpose" gnus-group-transpose-groups 918 ["Transpose" gnus-group-transpose-groups
783 (gnus-group-group-name)] 919 (gnus-group-group-name)]
784 ["Read a directory as a group..." gnus-group-enter-directory t])) 920 ["Read a directory as a group..." gnus-group-enter-directory t]))
785 921
786 (easy-menu-define 922 (easy-menu-define
787 gnus-group-misc-menu gnus-group-mode-map "" 923 gnus-group-misc-menu gnus-group-mode-map ""
788 '("Misc" 924 `("Gnus"
789 ("SOUP" 925 ("SOUP"
790 ["Pack replies" nnsoup-pack-replies (fboundp 'nnsoup-request-group)] 926 ["Pack replies" nnsoup-pack-replies (fboundp 'nnsoup-request-group)]
791 ["Send replies" gnus-soup-send-replies 927 ["Send replies" gnus-soup-send-replies
792 (fboundp 'gnus-soup-pack-packet)] 928 (fboundp 'gnus-soup-pack-packet)]
793 ["Pack packet" gnus-soup-pack-packet (fboundp 'gnus-soup-pack-packet)] 929 ["Pack packet" gnus-soup-pack-packet (fboundp 'gnus-soup-pack-packet)]
794 ["Save areas" gnus-soup-save-areas (fboundp 'gnus-soup-pack-packet)] 930 ["Save areas" gnus-soup-save-areas (fboundp 'gnus-soup-pack-packet)]
795 ["Brew SOUP" gnus-group-brew-soup (fboundp 'gnus-soup-pack-packet)]) 931 ["Brew SOUP" gnus-group-brew-soup (fboundp 'gnus-soup-pack-packet)])
796 ["Send a mail" gnus-group-mail t] 932 ["Send a mail" gnus-group-mail t]
797 ["Post an article..." gnus-group-post-news t] 933 ["Send a message (mail or news)" gnus-group-post-news t]
934 ["Create a local message" gnus-group-news t]
798 ["Check for new news" gnus-group-get-new-news 935 ["Check for new news" gnus-group-get-new-news
799 :help "Get newly arrived articles"] 936 ,@(if (featurep 'xemacs) '(t)
937 '(:help "Get newly arrived articles"))
938 ]
939 ["Send queued messages" gnus-delay-send-queue
940 ,@(if (featurep 'xemacs) '(t)
941 '(:help "Send all messages that are scheduled to be sent now"))
942 ]
800 ["Activate all groups" gnus-activate-all-groups t] 943 ["Activate all groups" gnus-activate-all-groups t]
801 ["Restart Gnus" gnus-group-restart t] 944 ["Restart Gnus" gnus-group-restart t]
802 ["Read init file" gnus-group-read-init-file t] 945 ["Read init file" gnus-group-read-init-file t]
803 ["Browse foreign server" gnus-group-browse-foreign-server t] 946 ["Browse foreign server..." gnus-group-browse-foreign-server t]
804 ["Enter server buffer" gnus-group-enter-server-mode t] 947 ["Enter server buffer" gnus-group-enter-server-mode t]
805 ["Expire all expirable articles" gnus-group-expire-all-groups t] 948 ["Expire all expirable articles" gnus-group-expire-all-groups t]
806 ["Generate any kiboze groups" nnkiboze-generate-groups t] 949 ["Generate any kiboze groups" nnkiboze-generate-groups t]
807 ["Gnus version" gnus-version t] 950 ["Gnus version" gnus-version t]
808 ["Save .newsrc files" gnus-group-save-newsrc t] 951 ["Save .newsrc files" gnus-group-save-newsrc t]
811 ["Read manual" gnus-info-find-node t] 954 ["Read manual" gnus-info-find-node t]
812 ["Flush score cache" gnus-score-flush-cache t] 955 ["Flush score cache" gnus-score-flush-cache t]
813 ["Toggle topics" gnus-topic-mode t] 956 ["Toggle topics" gnus-topic-mode t]
814 ["Send a bug report" gnus-bug t] 957 ["Send a bug report" gnus-bug t]
815 ["Exit from Gnus" gnus-group-exit 958 ["Exit from Gnus" gnus-group-exit
816 :help "Quit reading news"] 959 ,@(if (featurep 'xemacs) '(t)
960 '(:help "Quit reading news"))]
817 ["Exit without saving" gnus-group-quit t])) 961 ["Exit without saving" gnus-group-quit t]))
818 962
819 (gnus-run-hooks 'gnus-group-menu-hook))) 963 (gnus-run-hooks 'gnus-group-menu-hook)))
820 964
821 (defvar gnus-group-toolbar-map nil) 965 (defvar gnus-group-toolbar-map nil)
826 (condition-case nil (require 'tool-bar) (error nil)) 970 (condition-case nil (require 'tool-bar) (error nil))
827 (fboundp 'tool-bar-add-item-from-menu) 971 (fboundp 'tool-bar-add-item-from-menu)
828 (default-value 'tool-bar-mode) 972 (default-value 'tool-bar-mode)
829 (not gnus-group-toolbar-map)) 973 (not gnus-group-toolbar-map))
830 (setq gnus-group-toolbar-map 974 (setq gnus-group-toolbar-map
831 (let ((tool-bar-map (make-sparse-keymap))) 975 (let ((tool-bar-map (make-sparse-keymap))
976 (load-path (mm-image-load-path)))
832 (tool-bar-add-item-from-menu 977 (tool-bar-add-item-from-menu
833 'gnus-group-get-new-news "get-news" gnus-group-mode-map) 978 'gnus-group-get-new-news "get-news" gnus-group-mode-map)
834 (tool-bar-add-item-from-menu 979 (tool-bar-add-item-from-menu
835 'gnus-group-get-new-news-this-group "gnntg" gnus-group-mode-map) 980 'gnus-group-get-new-news-this-group "gnntg" gnus-group-mode-map)
836 (tool-bar-add-item-from-menu 981 (tool-bar-add-item-from-menu
889 (gnus-run-hooks 'gnus-group-mode-hook)) 1034 (gnus-run-hooks 'gnus-group-mode-hook))
890 1035
891 (defun gnus-update-group-mark-positions () 1036 (defun gnus-update-group-mark-positions ()
892 (save-excursion 1037 (save-excursion
893 (let ((gnus-process-mark ?\200) 1038 (let ((gnus-process-mark ?\200)
1039 (gnus-group-update-hook nil)
894 (gnus-group-marked '("dummy.group")) 1040 (gnus-group-marked '("dummy.group"))
895 (gnus-active-hashtb (make-vector 10 0)) 1041 (gnus-active-hashtb (make-vector 10 0))
896 (topic "")) 1042 (topic ""))
897 (gnus-set-active "dummy.group" '(0 . 0)) 1043 (gnus-set-active "dummy.group" '(0 . 0))
898 (gnus-set-work-buffer) 1044 (gnus-set-work-buffer)
930 (unless (eq major-mode 'gnus-group-mode) 1076 (unless (eq major-mode 'gnus-group-mode)
931 (gnus-group-mode) 1077 (gnus-group-mode)
932 (when gnus-carpal 1078 (when gnus-carpal
933 (gnus-carpal-setup-buffer 'group)))) 1079 (gnus-carpal-setup-buffer 'group))))
934 1080
935 (defsubst gnus-group-name-charset (method group) 1081 (defun gnus-group-name-charset (method group)
936 (if (null method) 1082 (if (null method)
937 (setq method (gnus-find-method-for-group group))) 1083 (setq method (gnus-find-method-for-group group)))
938 (let ((item (assoc method gnus-group-name-charset-method-alist)) 1084 (let ((item (assoc method gnus-group-name-charset-method-alist))
939 (alist gnus-group-name-charset-group-alist) 1085 (alist gnus-group-name-charset-group-alist)
940 result) 1086 result)
944 (if (string-match (car item) group) 1090 (if (string-match (car item) group)
945 (setq alist nil 1091 (setq alist nil
946 result (cdr item)))) 1092 result (cdr item))))
947 result))) 1093 result)))
948 1094
949 (defsubst gnus-group-name-decode (string charset) 1095 (defun gnus-group-name-decode (string charset)
1096 ;; Fixme: Don't decode in unibyte mode.
950 (if (and string charset (featurep 'mule)) 1097 (if (and string charset (featurep 'mule))
951 (mm-decode-coding-string string charset) 1098 (mm-decode-coding-string string charset)
952 string)) 1099 string))
953 1100
954 (defun gnus-group-decoded-name (string) 1101 (defun gnus-group-decoded-name (string)
1026 "List groups on LEVEL. 1173 "List groups on LEVEL.
1027 If ALL (the prefix), also list groups that have no unread articles." 1174 If ALL (the prefix), also list groups that have no unread articles."
1028 (interactive "nList groups on level: \nP") 1175 (interactive "nList groups on level: \nP")
1029 (gnus-group-list-groups level all level)) 1176 (gnus-group-list-groups level all level))
1030 1177
1031 (defun gnus-group-prepare-flat (level &optional all lowest regexp) 1178 (defun gnus-group-prepare-logic (group test)
1179 (or (and gnus-group-listed-groups
1180 (null gnus-group-list-option)
1181 (member group gnus-group-listed-groups))
1182 (cond
1183 ((null gnus-group-listed-groups) test)
1184 ((null gnus-group-list-option) test)
1185 (t (and (member group gnus-group-listed-groups)
1186 (if (eq gnus-group-list-option 'flush)
1187 (not test)
1188 test))))))
1189
1190 (defun gnus-group-prepare-flat (level &optional predicate lowest regexp)
1032 "List all newsgroups with unread articles of level LEVEL or lower. 1191 "List all newsgroups with unread articles of level LEVEL or lower.
1033 If ALL is non-nil, list groups that have no unread articles. 1192 If PREDICATE is a function, list groups that the function returns non-nil;
1193 if it is t, list groups that have no unread articles.
1034 If LOWEST is non-nil, list all newsgroups of level LOWEST or higher. 1194 If LOWEST is non-nil, list all newsgroups of level LOWEST or higher.
1035 If REGEXP, only list groups matching REGEXP." 1195 If REGEXP is a function, list dead groups that the function returns non-nil;
1196 if it is a string, only list groups matching REGEXP."
1036 (set-buffer gnus-group-buffer) 1197 (set-buffer gnus-group-buffer)
1037 (let ((buffer-read-only nil) 1198 (let ((buffer-read-only nil)
1038 (newsrc (cdr gnus-newsrc-alist)) 1199 (newsrc (cdr gnus-newsrc-alist))
1039 (lowest (or lowest 1)) 1200 (lowest (or lowest 1))
1201 (not-in-list (and gnus-group-listed-groups
1202 (copy-sequence gnus-group-listed-groups)))
1040 info clevel unread group params) 1203 info clevel unread group params)
1041 (erase-buffer) 1204 (erase-buffer)
1042 (when (< lowest gnus-level-zombie) 1205 (when (or (< lowest gnus-level-zombie)
1206 gnus-group-listed-groups)
1043 ;; List living groups. 1207 ;; List living groups.
1044 (while newsrc 1208 (while newsrc
1045 (setq info (car newsrc) 1209 (setq info (car newsrc)
1046 group (gnus-info-group info) 1210 group (gnus-info-group info)
1047 params (gnus-info-params info) 1211 params (gnus-info-params info)
1048 newsrc (cdr newsrc) 1212 newsrc (cdr newsrc)
1049 unread (car (gnus-gethash group gnus-newsrc-hashtb))) 1213 unread (car (gnus-gethash group gnus-newsrc-hashtb)))
1050 (and unread ; This group might be unchecked 1214 (when not-in-list
1051 (or (not regexp) 1215 (setq not-in-list (delete group not-in-list)))
1052 (string-match regexp group)) 1216 (when (gnus-group-prepare-logic
1053 (<= (setq clevel (gnus-info-level info)) level) 1217 group
1054 (>= clevel lowest) 1218 (and unread ; This group might be unchecked
1055 (or all ; We list all groups? 1219 (or (not (stringp regexp))
1056 (if (eq unread t) ; Unactivated? 1220 (string-match regexp group))
1057 gnus-group-list-inactive-groups ; We list unactivated 1221 (<= (setq clevel (gnus-info-level info)) level)
1058 (> unread 0)) ; We list groups with unread articles 1222 (>= clevel lowest)
1059 (and gnus-list-groups-with-ticked-articles 1223 (cond
1060 (cdr (assq 'tick (gnus-info-marks info)))) 1224 ((functionp predicate)
1225 (funcall predicate info))
1226 (predicate t) ; We list all groups?
1227 (t
1228 (or
1229 (if (eq unread t) ; Unactivated?
1230 gnus-group-list-inactive-groups
1231 ; We list unactivated
1232 (> unread 0))
1233 ; We list groups with unread articles
1234 (and gnus-list-groups-with-ticked-articles
1235 (cdr (assq 'tick (gnus-info-marks info))))
1061 ; And groups with tickeds 1236 ; And groups with tickeds
1062 ;; Check for permanent visibility. 1237 ;; Check for permanent visibility.
1063 (and gnus-permanently-visible-groups 1238 (and gnus-permanently-visible-groups
1064 (string-match gnus-permanently-visible-groups 1239 (string-match gnus-permanently-visible-groups
1065 group)) 1240 group))
1066 (memq 'visible params) 1241 (memq 'visible params)
1067 (cdr (assq 'visible params))) 1242 (cdr (assq 'visible params)))))))
1068 (gnus-group-insert-group-line 1243 (gnus-group-insert-group-line
1069 group (gnus-info-level info) 1244 group (gnus-info-level info)
1070 (gnus-info-marks info) unread (gnus-info-method info))))) 1245 (gnus-info-marks info) unread (gnus-info-method info)))))
1071 1246
1072 ;; List dead groups. 1247 ;; List dead groups.
1073 (and (>= level gnus-level-zombie) (<= lowest gnus-level-zombie) 1248 (when (or gnus-group-listed-groups
1074 (gnus-group-prepare-flat-list-dead 1249 (and (>= level gnus-level-zombie)
1075 (setq gnus-zombie-list (sort gnus-zombie-list 'string<)) 1250 (<= lowest gnus-level-zombie)))
1076 gnus-level-zombie ?Z 1251 (gnus-group-prepare-flat-list-dead
1077 regexp)) 1252 (setq gnus-zombie-list (sort gnus-zombie-list 'string<))
1078 (and (>= level gnus-level-killed) (<= lowest gnus-level-killed) 1253 gnus-level-zombie ?Z
1079 (gnus-group-prepare-flat-list-dead 1254 regexp))
1080 (setq gnus-killed-list (sort gnus-killed-list 'string<)) 1255 (when not-in-list
1081 gnus-level-killed ?K regexp)) 1256 (dolist (group gnus-zombie-list)
1257 (setq not-in-list (delete group not-in-list))))
1258 (when (or gnus-group-listed-groups
1259 (and (>= level gnus-level-killed) (<= lowest gnus-level-killed)))
1260 (gnus-group-prepare-flat-list-dead
1261 (gnus-union
1262 not-in-list
1263 (setq gnus-killed-list (sort gnus-killed-list 'string<)))
1264 gnus-level-killed ?K regexp))
1082 1265
1083 (gnus-group-set-mode-line) 1266 (gnus-group-set-mode-line)
1084 (setq gnus-group-list-mode (cons level all)) 1267 (setq gnus-group-list-mode (cons level predicate))
1085 (gnus-run-hooks 'gnus-group-prepare-hook) 1268 (gnus-run-hooks 'gnus-group-prepare-hook)
1086 t)) 1269 t))
1087 1270
1088 (defun gnus-group-prepare-flat-list-dead (groups level mark regexp) 1271 (defun gnus-group-prepare-flat-list-dead (groups level mark regexp)
1089 ;; List zombies and killed lists somewhat faster, which was 1272 ;; List zombies and killed lists somewhat faster, which was
1090 ;; suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>. It does 1273 ;; suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>. It does
1091 ;; this by ignoring the group format specification altogether. 1274 ;; this by ignoring the group format specification altogether.
1092 (let (group) 1275 (let (group)
1093 (if regexp 1276 (if (> (length groups) gnus-group-listing-limit)
1094 ;; This loop is used when listing groups that match some
1095 ;; regexp.
1096 (while groups 1277 (while groups
1097 (setq group (pop groups)) 1278 (setq group (pop groups))
1098 (when (string-match regexp group) 1279 (when (gnus-group-prepare-logic
1280 group
1281 (or (not regexp)
1282 (and (stringp regexp) (string-match regexp group))
1283 (and (functionp regexp) (funcall regexp group))))
1099 (gnus-add-text-properties 1284 (gnus-add-text-properties
1100 (point) (prog1 (1+ (point)) 1285 (point) (prog1 (1+ (point))
1101 (insert " " mark " *: " 1286 (insert " " mark " *: "
1102 (gnus-group-name-decode group 1287 (gnus-group-decoded-name group)
1103 (gnus-group-name-charset
1104 nil group))
1105 "\n")) 1288 "\n"))
1106 (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb) 1289 (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
1107 'gnus-unread t 1290 'gnus-unread t
1108 'gnus-level level)))) 1291 'gnus-level level))))
1109 ;; This loop is used when listing all groups.
1110 (while groups 1292 (while groups
1111 (setq group (pop groups)) 1293 (setq group (pop groups))
1112 (gnus-add-text-properties 1294 (when (gnus-group-prepare-logic
1113 (point) (prog1 (1+ (point)) 1295 group
1114 (insert " " mark " *: " 1296 (or (not regexp)
1115 (gnus-group-name-decode group 1297 (and (stringp regexp) (string-match regexp group))
1116 (gnus-group-name-charset 1298 (and (functionp regexp) (funcall regexp group))))
1117 nil group)) 1299 (gnus-group-insert-group-line
1118 "\n")) 1300 group level nil
1119 (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb) 1301 (let ((active (gnus-active group)))
1120 'gnus-unread t 1302 (if active
1121 'gnus-level level)))))) 1303 (if (zerop (cdr active))
1304 0
1305 (- (1+ (cdr active)) (car active)))
1306 nil))
1307 (gnus-method-simplify (gnus-find-method-for-group group))))))))
1122 1308
1123 (defun gnus-group-update-group-line () 1309 (defun gnus-group-update-group-line ()
1124 "Update the current line in the group buffer." 1310 "Update the current line in the group buffer."
1125 (let* ((buffer-read-only nil) 1311 (let* ((buffer-read-only nil)
1126 (group (gnus-group-group-name)) 1312 (group (gnus-group-group-name))
1159 (if (setq active (gnus-active group)) 1345 (if (setq active (gnus-active group))
1160 (if (zerop (cdr active)) 1346 (if (zerop (cdr active))
1161 0 1347 0
1162 (- (1+ (cdr active)) (car active))) 1348 (- (1+ (cdr active)) (car active)))
1163 nil) 1349 nil)
1164 nil)))) 1350 (gnus-method-simplify (gnus-find-method-for-group group))))))
1351
1352 (defun gnus-number-of-unseen-articles-in-group (group)
1353 (let* ((info (nth 2 (gnus-group-entry group)))
1354 (marked (gnus-info-marks info))
1355 (seen (cdr (assq 'seen marked)))
1356 (active (gnus-active group)))
1357 (if (not active)
1358 0
1359 (length (gnus-uncompress-range
1360 (gnus-range-difference
1361 (gnus-range-difference (list active) (gnus-info-read info))
1362 seen))))))
1165 1363
1166 (defun gnus-group-insert-group-line (gnus-tmp-group gnus-tmp-level 1364 (defun gnus-group-insert-group-line (gnus-tmp-group gnus-tmp-level
1167 gnus-tmp-marked number 1365 gnus-tmp-marked number
1168 gnus-tmp-method) 1366 gnus-tmp-method)
1169 "Insert a group line in the group buffer." 1367 "Insert a group line in the group buffer."
1189 ((= gnus-tmp-level gnus-level-zombie) ?Z) 1387 ((= gnus-tmp-level gnus-level-zombie) ?Z)
1190 (t ?K))) 1388 (t ?K)))
1191 (gnus-tmp-qualified-group 1389 (gnus-tmp-qualified-group
1192 (gnus-group-name-decode (gnus-group-real-name gnus-tmp-group) 1390 (gnus-group-name-decode (gnus-group-real-name gnus-tmp-group)
1193 group-name-charset)) 1391 group-name-charset))
1392 (gnus-tmp-comment
1393 (or (gnus-group-get-parameter gnus-tmp-group 'comment t)
1394 gnus-tmp-group))
1194 (gnus-tmp-newsgroup-description 1395 (gnus-tmp-newsgroup-description
1195 (if gnus-description-hashtb 1396 (if gnus-description-hashtb
1196 (or (gnus-group-name-decode 1397 (or (gnus-group-name-decode
1197 (gnus-gethash gnus-tmp-group gnus-description-hashtb) 1398 (gnus-gethash gnus-tmp-group gnus-description-hashtb)
1198 group-name-charset) "") 1399 group-name-charset) "")
1213 (gnus-tmp-marked-mark 1414 (gnus-tmp-marked-mark
1214 (if (and (numberp number) 1415 (if (and (numberp number)
1215 (zerop number) 1416 (zerop number)
1216 (cdr (assq 'tick gnus-tmp-marked))) 1417 (cdr (assq 'tick gnus-tmp-marked)))
1217 ?* ? )) 1418 ?* ? ))
1419 (gnus-tmp-summary-live
1420 (if (and (not gnus-group-is-exiting-p)
1421 (gnus-buffer-live-p (gnus-summary-buffer-name
1422 gnus-tmp-group)))
1423 ?* ? ))
1218 (gnus-tmp-process-marked 1424 (gnus-tmp-process-marked
1219 (if (member gnus-tmp-group gnus-group-marked) 1425 (if (member gnus-tmp-group gnus-group-marked)
1220 gnus-process-mark ? )) 1426 gnus-process-mark ? ))
1221 (gnus-tmp-grouplens 1427 (gnus-tmp-grouplens
1222 (or (and gnus-use-grouplens 1428 (or (and gnus-use-grouplens
1227 (beginning-of-line) 1433 (beginning-of-line)
1228 (gnus-add-text-properties 1434 (gnus-add-text-properties
1229 (point) 1435 (point)
1230 (prog1 (1+ (point)) 1436 (prog1 (1+ (point))
1231 ;; Insert the text. 1437 ;; Insert the text.
1232 (eval gnus-group-line-format-spec)) 1438 (let ((gnus-tmp-group (gnus-group-name-decode
1439 gnus-tmp-group group-name-charset)))
1440 (eval gnus-group-line-format-spec)))
1233 `(gnus-group ,(gnus-intern-safe gnus-tmp-group gnus-active-hashtb) 1441 `(gnus-group ,(gnus-intern-safe gnus-tmp-group gnus-active-hashtb)
1234 gnus-unread ,(if (numberp number) 1442 gnus-unread ,(if (numberp number)
1235 (string-to-int gnus-tmp-number-of-unread) 1443 (string-to-int gnus-tmp-number-of-unread)
1236 t) 1444 t)
1237 gnus-marked ,gnus-tmp-marked-mark 1445 gnus-marked ,gnus-tmp-marked-mark
1246 1454
1247 (defun gnus-group-highlight-line () 1455 (defun gnus-group-highlight-line ()
1248 "Highlight the current line according to `gnus-group-highlight'." 1456 "Highlight the current line according to `gnus-group-highlight'."
1249 (let* ((list gnus-group-highlight) 1457 (let* ((list gnus-group-highlight)
1250 (p (point)) 1458 (p (point))
1251 (end (progn (end-of-line) (point))) 1459 (end (gnus-point-at-eol))
1252 ;; now find out where the line starts and leave point there. 1460 ;; now find out where the line starts and leave point there.
1253 (beg (progn (beginning-of-line) (point))) 1461 (beg (progn (beginning-of-line) (point)))
1254 (group (gnus-group-group-name)) 1462 (group (gnus-group-group-name))
1255 (entry (gnus-group-entry group)) 1463 (entry (gnus-group-entry group))
1256 (unread (if (numberp (car entry)) (car entry) 0)) 1464 (unread (if (numberp (car entry)) (car entry) 0))
1257 (active (gnus-active group)) 1465 (active (gnus-active group))
1258 (total (if active (1+ (- (cdr active) (car active))) 0)) 1466 (total (if active (1+ (- (cdr active) (car active))) 0))
1259 (info (nth 2 entry)) 1467 (info (nth 2 entry))
1260 (method (gnus-server-get-method group (gnus-info-method info))) 1468 (method (inline (gnus-server-get-method group (gnus-info-method info))))
1261 (marked (gnus-info-marks info)) 1469 (marked (gnus-info-marks info))
1262 (mailp (memq 'mail (assoc (symbol-name 1470 (mailp (apply 'append
1263 (car (or method gnus-select-method))) 1471 (mapcar
1264 gnus-valid-select-methods))) 1472 (lambda (x)
1473 (memq x (assoc (symbol-name
1474 (car (or method gnus-select-method)))
1475 gnus-valid-select-methods)))
1476 '(mail post-mail))))
1265 (level (or (gnus-info-level info) gnus-level-killed)) 1477 (level (or (gnus-info-level info) gnus-level-killed))
1266 (score (or (gnus-info-score info) 0)) 1478 (score (or (gnus-info-score info) 0))
1267 (ticked (gnus-range-length (cdr (assq 'tick marked)))) 1479 (ticked (gnus-range-length (cdr (assq 'tick marked))))
1268 (group-age (gnus-group-timestamp-delta group)) 1480 (group-age (gnus-group-timestamp-delta group))
1269 (inhibit-read-only t)) 1481 (inhibit-read-only t))
1524 (defun gnus-group-mark-regexp (regexp) 1736 (defun gnus-group-mark-regexp (regexp)
1525 "Mark all groups that match some regexp." 1737 "Mark all groups that match some regexp."
1526 (interactive "sMark (regexp): ") 1738 (interactive "sMark (regexp): ")
1527 (let ((alist (cdr gnus-newsrc-alist)) 1739 (let ((alist (cdr gnus-newsrc-alist))
1528 group) 1740 group)
1529 (while alist 1741 (save-excursion
1530 (when (string-match regexp (setq group (gnus-info-group (pop alist)))) 1742 (while alist
1531 (gnus-group-set-mark group)))) 1743 (when (string-match regexp (setq group (gnus-info-group (pop alist))))
1744 (gnus-group-jump-to-group group)
1745 (gnus-group-set-mark group)))))
1532 (gnus-group-position-point)) 1746 (gnus-group-position-point))
1533 1747
1534 (defun gnus-group-remove-mark (group &optional test-marked) 1748 (defun gnus-group-remove-mark (group &optional test-marked)
1535 "Remove the process mark from GROUP and move point there. 1749 "Remove the process mark from GROUP and move point there.
1536 Return nil if the group isn't displayed." 1750 Return nil if the group isn't displayed."
1580 (if (setq group (gnus-group-group-name)) 1794 (if (setq group (gnus-group-group-name))
1581 (push group groups)) 1795 (push group groups))
1582 (setq n (1- n)) 1796 (setq n (1- n))
1583 (gnus-group-next-group way))) 1797 (gnus-group-next-group way)))
1584 (nreverse groups))) 1798 (nreverse groups)))
1585 ((gnus-region-active-p) 1799 ((and (gnus-region-active-p) (mark))
1586 ;; Work on the region between point and mark. 1800 ;; Work on the region between point and mark.
1587 (let ((max (max (point) (mark))) 1801 (let ((max (max (point) (mark)))
1588 groups) 1802 groups)
1589 (save-excursion 1803 (save-excursion
1590 (goto-char (min (point) (mark))) 1804 (goto-char (min (point) (mark)))
1665 no-article nil no-display nil select-articles))) 1879 no-article nil no-display nil select-articles)))
1666 1880
1667 (defun gnus-group-select-group (&optional all) 1881 (defun gnus-group-select-group (&optional all)
1668 "Select this newsgroup. 1882 "Select this newsgroup.
1669 No article is selected automatically. 1883 No article is selected automatically.
1884 If the group is opened, just switch the summary buffer.
1670 If ALL is non-nil, already read articles become readable. 1885 If ALL is non-nil, already read articles become readable.
1671 If ALL is a number, fetch this number of articles." 1886 If ALL is a number, fetch this number of articles."
1672 (interactive "P") 1887 (interactive "P")
1888 (when (and (eobp) (not (gnus-group-group-name)))
1889 (forward-line -1))
1673 (gnus-group-read-group all t)) 1890 (gnus-group-read-group all t))
1674 1891
1675 (defun gnus-group-quick-select-group (&optional all) 1892 (defun gnus-group-quick-select-group (&optional all)
1676 "Select the current group \"quickly\". 1893 "Select the current group \"quickly\".
1677 This means that no highlighting or scoring will be performed. 1894 This means that no highlighting or scoring will be performed.
1710 (method (gnus-find-method-for-group group))) 1927 (method (gnus-find-method-for-group group)))
1711 (gnus-group-read-ephemeral-group 1928 (gnus-group-read-ephemeral-group
1712 (gnus-group-prefixed-name group method) method))) 1929 (gnus-group-prefixed-name group method) method)))
1713 1930
1714 ;;;###autoload 1931 ;;;###autoload
1715 (defun gnus-fetch-group (group) 1932 (defun gnus-fetch-group (group &optional articles)
1716 "Start Gnus if necessary and enter GROUP. 1933 "Start Gnus if necessary and enter GROUP.
1717 Returns whether the fetching was successful or not." 1934 Returns whether the fetching was successful or not."
1718 (interactive (list (completing-read "Group name: " gnus-active-hashtb))) 1935 (interactive (list (completing-read "Group name: " gnus-active-hashtb)))
1719 (unless (get-buffer gnus-group-buffer) 1936 (unless (get-buffer gnus-group-buffer)
1720 (gnus-no-server)) 1937 (gnus-no-server))
1721 (gnus-group-read-group nil nil group)) 1938 (gnus-group-read-group articles nil group))
1722 1939
1723 ;;;###autoload 1940 ;;;###autoload
1724 (defun gnus-fetch-group-other-frame (group) 1941 (defun gnus-fetch-group-other-frame (group)
1725 "Pop up a frame and enter GROUP." 1942 "Pop up a frame and enter GROUP."
1726 (interactive "P") 1943 (interactive "P")
1733 (other-frame 1)))) 1950 (other-frame 1))))
1734 (gnus-fetch-group group)) 1951 (gnus-fetch-group group))
1735 1952
1736 (defvar gnus-ephemeral-group-server 0) 1953 (defvar gnus-ephemeral-group-server 0)
1737 1954
1955 (defcustom gnus-large-ephemeral-newsgroup 200
1956 "The number of articles which indicates a large ephemeral newsgroup.
1957 Same as `gnus-large-newsgroup', but only used for ephemeral newsgroups.
1958
1959 If the number of articles in a newsgroup is greater than this value,
1960 confirmation is required for selecting the newsgroup. If it is nil, no
1961 confirmation is required."
1962 :group 'gnus-group-select
1963 :type '(choice (const :tag "No limit" nil)
1964 integer))
1965
1966 (defcustom gnus-fetch-old-ephemeral-headers nil
1967 "Same as `gnus-fetch-old-headers', but only used for ephemeral newsgroups."
1968 :group 'gnus-thread
1969 :type '(choice (const :tag "off" nil)
1970 (const some)
1971 number
1972 (sexp :menu-tag "other" t)))
1973
1738 ;; Enter a group that is not in the group buffer. Non-nil is returned 1974 ;; Enter a group that is not in the group buffer. Non-nil is returned
1739 ;; if selection was successful. 1975 ;; if selection was successful.
1740 (defun gnus-group-read-ephemeral-group (group method &optional activate 1976 (defun gnus-group-read-ephemeral-group (group method &optional activate
1741 quit-config request-only 1977 quit-config request-only
1742 select-articles) 1978 select-articles
1979 parameters)
1743 "Read GROUP from METHOD as an ephemeral group. 1980 "Read GROUP from METHOD as an ephemeral group.
1744 If ACTIVATE, request the group first. 1981 If ACTIVATE, request the group first.
1745 If QUIT-CONFIG, use that window configuration when exiting from the 1982 If QUIT-CONFIG, use that window configuration when exiting from the
1746 ephemeral group. 1983 ephemeral group.
1747 If REQUEST-ONLY, don't actually read the group; just request it. 1984 If REQUEST-ONLY, don't actually read the group; just request it.
1748 If SELECT-ARTICLES, only select those articles. 1985 If SELECT-ARTICLES, only select those articles.
1986 If PARAMETERS, use those as the group parameters.
1749 1987
1750 Return the name of the group if selection was successful." 1988 Return the name of the group if selection was successful."
1989 (interactive
1990 (list
1991 ;; (gnus-read-group "Group name: ")
1992 (completing-read
1993 "Group: " gnus-active-hashtb
1994 nil nil nil
1995 'gnus-group-history)
1996 (gnus-read-method "From method: ")))
1751 ;; Transform the select method into a unique server. 1997 ;; Transform the select method into a unique server.
1752 (when (stringp method) 1998 (when (stringp method)
1753 (setq method (gnus-server-to-method method))) 1999 (setq method (gnus-server-to-method method)))
1754 (setq method 2000 (setq method
1755 `(,(car method) ,(concat (cadr method) "-ephemeral") 2001 `(,(car method) ,(concat (cadr method) "-ephemeral")
1756 (,(intern (format "%s-address" (car method))) ,(cadr method)) 2002 (,(intern (format "%s-address" (car method))) ,(cadr method))
1757 ,@(cddr method))) 2003 ,@(cddr method)))
1758 (let ((group (if (gnus-group-foreign-p group) group 2004 (let ((group (if (gnus-group-foreign-p group) group
1759 (gnus-group-prefixed-name group method)))) 2005 (gnus-group-prefixed-name (gnus-group-real-name group)
2006 method))))
1760 (gnus-sethash 2007 (gnus-sethash
1761 group 2008 group
1762 `(-1 nil (,group 2009 `(-1 nil (,group
1763 ,gnus-level-default-subscribed nil nil ,method 2010 ,gnus-level-default-subscribed nil nil ,method
1764 ((quit-config . 2011 ,(cons
1765 ,(if quit-config quit-config 2012 (if quit-config
1766 (cons gnus-summary-buffer 2013 (cons 'quit-config quit-config)
1767 gnus-current-window-configuration)))))) 2014 (cons 'quit-config
2015 (cons gnus-summary-buffer
2016 gnus-current-window-configuration)))
2017 parameters)))
1768 gnus-newsrc-hashtb) 2018 gnus-newsrc-hashtb)
1769 (push method gnus-ephemeral-servers) 2019 (push method gnus-ephemeral-servers)
1770 (set-buffer gnus-group-buffer) 2020 (set-buffer gnus-group-buffer)
1771 (unless (gnus-check-server method) 2021 (unless (gnus-check-server method)
1772 (error "Unable to contact server: %s" (gnus-status-message method))) 2022 (error "Unable to contact server: %s" (gnus-status-message method)))
1776 (error "Couldn't request group: %s" 2026 (error "Couldn't request group: %s"
1777 (nnheader-get-report (car method))))) 2027 (nnheader-get-report (car method)))))
1778 (if request-only 2028 (if request-only
1779 group 2029 group
1780 (condition-case () 2030 (condition-case ()
1781 (when (gnus-group-read-group t t group select-articles) 2031 (when (let ((gnus-large-newsgroup gnus-large-ephemeral-newsgroup)
2032 (gnus-fetch-old-headers
2033 gnus-fetch-old-ephemeral-headers))
2034 (gnus-group-read-group t t group select-articles))
1782 group) 2035 group)
1783 ;;(error nil) 2036 ;;(error nil)
1784 (quit 2037 (quit
1785 (message "Quit reading the ephemeral group") 2038 (message "Quit reading the ephemeral group")
1786 nil))))) 2039 nil)))))
1787 2040
1788 (defun gnus-group-jump-to-group (group) 2041 (defun gnus-group-jump-to-group (group)
1789 "Jump to newsgroup GROUP." 2042 "Jump to newsgroup GROUP."
1790 (interactive 2043 (interactive
1791 (list (completing-read 2044 (list (mm-string-make-unibyte
1792 "Group: " gnus-active-hashtb nil 2045 (completing-read
1793 (gnus-read-active-file-p) 2046 "Group: " gnus-active-hashtb nil
1794 nil 2047 (gnus-read-active-file-p)
1795 'gnus-group-history))) 2048 gnus-group-jump-to-group-prompt
2049 'gnus-group-history))))
1796 2050
1797 (when (equal group "") 2051 (when (equal group "")
1798 (error "Empty group name")) 2052 (error "Empty group name"))
1799 2053
1800 (unless (gnus-ephemeral-group-p group) 2054 (unless (gnus-ephemeral-group-p group)
1935 (setq best (get-text-property (point) 'gnus-level)) 2189 (setq best (get-text-property (point) 'gnus-level))
1936 (setq best-point (point)))) 2190 (setq best-point (point))))
1937 (forward-line 1)) 2191 (forward-line 1))
1938 (when best-point 2192 (when best-point
1939 (goto-char best-point)) 2193 (goto-char best-point))
1940 (gnus-summary-position-point) 2194 (gnus-group-position-point)
1941 (and best-point (gnus-group-group-name)))) 2195 (and best-point (gnus-group-group-name))))
1942 2196
1943 (defun gnus-group-first-unread-group () 2197 (defun gnus-group-first-unread-group ()
1944 "Go to the first group with unread articles." 2198 "Go to the first group with unread articles."
1945 (interactive) 2199 (interactive)
1998 ;; Insert the line. 2252 ;; Insert the line.
1999 (gnus-group-insert-group-line-info nname) 2253 (gnus-group-insert-group-line-info nname)
2000 (forward-line -1) 2254 (forward-line -1)
2001 (gnus-group-position-point) 2255 (gnus-group-position-point)
2002 2256
2003 ;; Load the backend and try to make the backend create 2257 ;; Load the back end and try to make the back end create
2004 ;; the group as well. 2258 ;; the group as well.
2005 (when (assoc (symbol-name (setq backend (car (gnus-server-get-method 2259 (when (assoc (symbol-name (setq backend (car (gnus-server-get-method
2006 nil meth)))) 2260 nil meth))))
2007 gnus-valid-select-methods) 2261 gnus-valid-select-methods)
2008 (require backend)) 2262 (require backend))
2009 (gnus-check-server meth) 2263 (gnus-check-server meth)
2010 (when (gnus-check-backend-function 'request-create-group nname) 2264 (when (gnus-check-backend-function 'request-create-group nname)
2011 (gnus-request-create-group nname nil args)) 2265 (unless (gnus-request-create-group nname nil args)
2266 (error "Could not create group on server: %s"
2267 (nnheader-get-report backend))))
2012 t)) 2268 t))
2013 2269
2014 (defun gnus-group-delete-groups (&optional arg) 2270 (defun gnus-group-delete-groups (&optional arg)
2015 "Delete the current group. Only meaningful with editable groups." 2271 "Delete the current group. Only meaningful with editable groups."
2016 (interactive "P") 2272 (interactive "P")
2021 (format "Delete these %d groups? " n))) 2277 (format "Delete these %d groups? " n)))
2022 (gnus-group-iterate arg 2278 (gnus-group-iterate arg
2023 (lambda (group) 2279 (lambda (group)
2024 (gnus-group-delete-group group nil t)))))) 2280 (gnus-group-delete-group group nil t))))))
2025 2281
2282 (defvar gnus-cache-active-altered)
2283
2026 (defun gnus-group-delete-group (group &optional force no-prompt) 2284 (defun gnus-group-delete-group (group &optional force no-prompt)
2027 "Delete the current group. Only meaningful with editable groups. 2285 "Delete the current group. Only meaningful with editable groups.
2028 If FORCE (the prefix) is non-nil, all the articles in the group will 2286 If FORCE (the prefix) is non-nil, all the articles in the group will
2029 be deleted. This is \"deleted\" as in \"removed forever from the face 2287 be deleted. This is \"deleted\" as in \"removed forever from the face
2030 of the Earth\". There is no undo. The user will be prompted before 2288 of the Earth\". There is no undo. The user will be prompted before
2031 doing the deletion." 2289 doing the deletion.
2290 Note that you also have to specify FORCE if you want the group to
2291 be removed from the server, even when it's empty."
2032 (interactive 2292 (interactive
2033 (list (gnus-group-group-name) 2293 (list (gnus-group-group-name)
2034 current-prefix-arg)) 2294 current-prefix-arg))
2035 (unless group 2295 (unless group
2036 (error "No group to rename")) 2296 (error "No group to delete"))
2037 (unless (gnus-check-backend-function 'request-delete-group group) 2297 (unless (gnus-check-backend-function 'request-delete-group group)
2038 (error "This backend does not support group deletion")) 2298 (error "This back end does not support group deletion"))
2039 (prog1 2299 (prog1
2040 (if (and (not no-prompt) 2300 (if (and (not no-prompt)
2041 (not (gnus-yes-or-no-p 2301 (not (gnus-yes-or-no-p
2042 (format 2302 (format
2043 "Do you really want to delete %s%s? " 2303 "Do you really want to delete %s%s? "
2048 (gnus-error 3 "Couldn't delete group %s" group) 2308 (gnus-error 3 "Couldn't delete group %s" group)
2049 (gnus-message 6 "Deleting group %s...done" group) 2309 (gnus-message 6 "Deleting group %s...done" group)
2050 (gnus-group-goto-group group) 2310 (gnus-group-goto-group group)
2051 (gnus-group-kill-group 1 t) 2311 (gnus-group-kill-group 1 t)
2052 (gnus-sethash group nil gnus-active-hashtb) 2312 (gnus-sethash group nil gnus-active-hashtb)
2313 (if (boundp 'gnus-cache-active-hashtb)
2314 (when gnus-cache-active-hashtb
2315 (gnus-sethash group nil gnus-cache-active-hashtb)
2316 (setq gnus-cache-active-altered t)))
2053 t)) 2317 t))
2054 (gnus-group-position-point))) 2318 (gnus-group-position-point)))
2055 2319
2056 (defun gnus-group-rename-group (group new-name) 2320 (defun gnus-group-rename-group (group new-name)
2057 "Rename group from GROUP to NEW-NAME. 2321 "Rename group from GROUP to NEW-NAME.
2061 (list 2325 (list
2062 (gnus-group-group-name) 2326 (gnus-group-group-name)
2063 (progn 2327 (progn
2064 (unless (gnus-check-backend-function 2328 (unless (gnus-check-backend-function
2065 'request-rename-group (gnus-group-group-name)) 2329 'request-rename-group (gnus-group-group-name))
2066 (error "This backend does not support renaming groups")) 2330 (error "This back end does not support renaming groups"))
2067 (gnus-read-group "Rename group to: " 2331 (gnus-read-group "Rename group to: "
2068 (gnus-group-real-name (gnus-group-group-name)))))) 2332 (gnus-group-real-name (gnus-group-group-name))))))
2069 2333
2070 (unless (gnus-check-backend-function 'request-rename-group group) 2334 (unless (gnus-check-backend-function 'request-rename-group group)
2071 (error "This backend does not support renaming groups")) 2335 (error "This back end does not support renaming groups"))
2072 (unless group 2336 (unless group
2073 (error "No group to rename")) 2337 (error "No group to rename"))
2074 (when (equal (gnus-group-real-name group) new-name) 2338 (when (equal (gnus-group-real-name group) new-name)
2075 (error "Can't rename to the same name")) 2339 (error "Can't rename to the same name"))
2076 2340
2081 new-name 2345 new-name
2082 ;; Foreign group. 2346 ;; Foreign group.
2083 (gnus-group-prefixed-name 2347 (gnus-group-prefixed-name
2084 (gnus-group-real-name new-name) 2348 (gnus-group-real-name new-name)
2085 (gnus-info-method (gnus-get-info group))))) 2349 (gnus-info-method (gnus-get-info group)))))
2350
2351 (when (gnus-active new-name)
2352 (error "The group %s already exists" new-name))
2086 2353
2087 (gnus-message 6 "Renaming group %s to %s..." group new-name) 2354 (gnus-message 6 "Renaming group %s to %s..." group new-name)
2088 (prog1 2355 (prog1
2089 (if (progn 2356 (if (progn
2090 (gnus-group-goto-group group) 2357 (gnus-group-goto-group group)
2130 ((eq part 'method) "select method") 2397 ((eq part 'method) "select method")
2131 ((eq part 'params) "group parameters") 2398 ((eq part 'params) "group parameters")
2132 (t "group info")) 2399 (t "group info"))
2133 (gnus-group-decoded-name group)) 2400 (gnus-group-decoded-name group))
2134 `(lambda (form) 2401 `(lambda (form)
2135 (gnus-group-edit-group-done ',part ,group form))))) 2402 (gnus-group-edit-group-done ',part ,group form)))
2403 (local-set-key
2404 "\C-c\C-i"
2405 (gnus-create-info-command
2406 (cond
2407 ((eq part 'method)
2408 "(gnus)Select Methods")
2409 ((eq part 'params)
2410 "(gnus)Group Parameters")
2411 (t
2412 "(gnus)Group Info"))))))
2136 2413
2137 (defun gnus-group-edit-group-method (group) 2414 (defun gnus-group-edit-group-method (group)
2138 "Edit the select method of GROUP." 2415 "Edit the select method of GROUP."
2139 (interactive (list (gnus-group-group-name))) 2416 (interactive (list (gnus-group-group-name)))
2140 (gnus-group-edit-group group 'method)) 2417 (gnus-group-edit-group group 'method))
2191 (let (entry) 2468 (let (entry)
2192 (while (setq entry (memq (assq 'eval method) method)) 2469 (while (setq entry (memq (assq 'eval method) method))
2193 (setcar entry (eval (cadar entry))))) 2470 (setcar entry (eval (cadar entry)))))
2194 (gnus-group-make-group group method)) 2471 (gnus-group-make-group group method))
2195 2472
2196 (defun gnus-group-make-help-group () 2473 (defun gnus-group-make-help-group (&optional noerror)
2197 "Create the Gnus documentation group." 2474 "Create the Gnus documentation group.
2475 Optional argument NOERROR modifies the behavior of this function when the
2476 group already exists:
2477 - if not given, and error is signaled,
2478 - if t, stay silent,
2479 - if anything else, just print a message."
2198 (interactive) 2480 (interactive)
2199 (let ((name (gnus-group-prefixed-name "gnus-help" '(nndoc "gnus-help"))) 2481 (let ((name (gnus-group-prefixed-name "gnus-help" '(nndoc "gnus-help")))
2200 (file (nnheader-find-etc-directory "gnus-tut.txt" t))) 2482 (file (nnheader-find-etc-directory "gnus-tut.txt" t)))
2201 (when (gnus-gethash name gnus-newsrc-hashtb) 2483 (if (gnus-gethash name gnus-newsrc-hashtb)
2202 (error "Documentation group already exists")) 2484 (cond ((eq noerror nil)
2203 (if (not file) 2485 (error "Documentation group already exists"))
2204 (gnus-message 1 "Couldn't find doc group") 2486 ((eq noerror t)
2205 (gnus-group-make-group 2487 ;; stay silent
2206 (gnus-group-real-name name) 2488 )
2207 (list 'nndoc "gnus-help" 2489 (t
2208 (list 'nndoc-address file) 2490 (gnus-message 1 "Documentation group already exists")))
2209 (list 'nndoc-article-type 'mbox))))) 2491 ;; else:
2492 (if (not file)
2493 (gnus-message 1 "Couldn't find doc group")
2494 (gnus-group-make-group
2495 (gnus-group-real-name name)
2496 (list 'nndoc "gnus-help"
2497 (list 'nndoc-address file)
2498 (list 'nndoc-article-type 'mbox))))
2499 ))
2210 (gnus-group-position-point)) 2500 (gnus-group-position-point))
2211 2501
2212 (defun gnus-group-make-doc-group (file type) 2502 (defun gnus-group-make-doc-group (file type)
2213 "Create a group that uses a single file as the source." 2503 "Create a group that uses a single file as the source."
2214 (interactive 2504 (interactive
2269 (method 2559 (method
2270 `(nnweb ,group (nnweb-search ,search) 2560 `(nnweb ,group (nnweb-search ,search)
2271 (nnweb-type ,(intern type)) 2561 (nnweb-type ,(intern type))
2272 (nnweb-ephemeral-p t)))) 2562 (nnweb-ephemeral-p t))))
2273 (if solid 2563 (if solid
2274 (gnus-group-make-group group "nnweb" "" `(,(intern type) ,search)) 2564 (progn
2565 (gnus-pull 'nnweb-ephemeral-p method)
2566 (gnus-group-make-group group method))
2275 (gnus-group-read-ephemeral-group 2567 (gnus-group-read-ephemeral-group
2276 group method t 2568 group method t
2277 (cons (current-buffer) 2569 (cons (current-buffer)
2278 (if (eq major-mode 'gnus-summary-mode) 'summary 'group)))))) 2570 (if (eq major-mode 'gnus-summary-mode) 'summary 'group))))))
2571
2572 (eval-when-compile
2573 (defvar nnrss-group-alist)
2574 (defun nnrss-discover-feed (arg))
2575 (defun nnrss-save-server-data (arg)))
2576 (defun gnus-group-make-rss-group (&optional url)
2577 "Given a URL, discover if there is an RSS feed.
2578 If there is, use Gnus to create an nnrss group"
2579 (interactive)
2580 (require 'nnrss)
2581 (if (not url)
2582 (setq url (read-from-minibuffer "URL to Search for RSS: ")))
2583 (let ((feedinfo (nnrss-discover-feed url)))
2584 (if feedinfo
2585 (let ((title (read-from-minibuffer "Title: "
2586 (cdr (assoc 'title
2587 feedinfo))))
2588 (desc (read-from-minibuffer "Description: "
2589 (cdr (assoc 'description
2590 feedinfo))))
2591 (href (cdr (assoc 'href feedinfo))))
2592 (push (list title href desc)
2593 nnrss-group-alist)
2594 (gnus-group-unsubscribe-group
2595 (concat "nnrss:" title))
2596 (nnrss-save-server-data nil))
2597 (error "No feeds found for %s" url))))
2279 2598
2280 (defvar nnwarchive-type-definition) 2599 (defvar nnwarchive-type-definition)
2281 (defvar gnus-group-warchive-type-history nil) 2600 (defvar gnus-group-warchive-type-history nil)
2282 (defvar gnus-group-warchive-login-history nil) 2601 (defvar gnus-group-warchive-login-history nil)
2283 (defvar gnus-group-warchive-address-history nil) 2602 (defvar gnus-group-warchive-address-history nil)
2351 (setq ext (format "<%d>" (setq i (1+ i))))) 2670 (setq ext (format "<%d>" (setq i (1+ i)))))
2352 (gnus-group-make-group 2671 (gnus-group-make-group
2353 (gnus-group-real-name group) 2672 (gnus-group-real-name group)
2354 (list 'nndir (gnus-group-real-name group) (list 'nndir-directory dir))))) 2673 (list 'nndir (gnus-group-real-name group) (list 'nndir-directory dir)))))
2355 2674
2356 (eval-when-compile (defvar nnkiboze-score-file)) 2675 (defvar nnkiboze-score-file)
2357 (defun gnus-group-make-kiboze-group (group address scores) 2676 (defun gnus-group-make-kiboze-group (group address scores)
2358 "Create an nnkiboze group. 2677 "Create an nnkiboze group.
2359 The user will be prompted for a name, a regexp to match groups, and 2678 The user will be prompted for a name, a regexp to match groups, and
2360 score file entries for articles to include in the group." 2679 score file entries for articles to include in the group."
2361 (interactive 2680 (interactive
2502 determined by the `gnus-group-sort-function' variable. 2821 determined by the `gnus-group-sort-function' variable.
2503 If REVERSE (the prefix), reverse the sorting order." 2822 If REVERSE (the prefix), reverse the sorting order."
2504 (interactive (list gnus-group-sort-function current-prefix-arg)) 2823 (interactive (list gnus-group-sort-function current-prefix-arg))
2505 (funcall gnus-group-sort-alist-function 2824 (funcall gnus-group-sort-alist-function
2506 (gnus-make-sort-function func) reverse) 2825 (gnus-make-sort-function func) reverse)
2826 (gnus-group-unmark-all-groups)
2507 (gnus-group-list-groups) 2827 (gnus-group-list-groups)
2508 (gnus-dribble-touch)) 2828 (gnus-dribble-touch))
2509 2829
2510 (defun gnus-group-sort-flat (func reverse) 2830 (defun gnus-group-sort-flat (func reverse)
2511 ;; We peel off the dummy group from the alist. 2831 ;; We peel off the dummy group from the alist.
2524 "Sort the group buffer alphabetically by group name. 2844 "Sort the group buffer alphabetically by group name.
2525 If REVERSE, sort in reverse order." 2845 If REVERSE, sort in reverse order."
2526 (interactive "P") 2846 (interactive "P")
2527 (gnus-group-sort-groups 'gnus-group-sort-by-alphabet reverse)) 2847 (gnus-group-sort-groups 'gnus-group-sort-by-alphabet reverse))
2528 2848
2849 (defun gnus-group-sort-groups-by-real-name (&optional reverse)
2850 "Sort the group buffer alphabetically by real (unprefixed) group name.
2851 If REVERSE, sort in reverse order."
2852 (interactive "P")
2853 (gnus-group-sort-groups 'gnus-group-sort-by-real-name reverse))
2854
2529 (defun gnus-group-sort-groups-by-unread (&optional reverse) 2855 (defun gnus-group-sort-groups-by-unread (&optional reverse)
2530 "Sort the group buffer by number of unread articles. 2856 "Sort the group buffer by number of unread articles.
2531 If REVERSE, sort in reverse order." 2857 If REVERSE, sort in reverse order."
2532 (interactive "P") 2858 (interactive "P")
2533 (gnus-group-sort-groups 'gnus-group-sort-by-unread reverse)) 2859 (gnus-group-sort-groups 'gnus-group-sort-by-unread reverse))
2549 If REVERSE, sort in reverse order." 2875 If REVERSE, sort in reverse order."
2550 (interactive "P") 2876 (interactive "P")
2551 (gnus-group-sort-groups 'gnus-group-sort-by-rank reverse)) 2877 (gnus-group-sort-groups 'gnus-group-sort-by-rank reverse))
2552 2878
2553 (defun gnus-group-sort-groups-by-method (&optional reverse) 2879 (defun gnus-group-sort-groups-by-method (&optional reverse)
2554 "Sort the group buffer alphabetically by backend name. 2880 "Sort the group buffer alphabetically by back end name.
2555 If REVERSE, sort in reverse order." 2881 If REVERSE, sort in reverse order."
2556 (interactive "P") 2882 (interactive "P")
2557 (gnus-group-sort-groups 'gnus-group-sort-by-method reverse)) 2883 (gnus-group-sort-groups 'gnus-group-sort-by-method reverse))
2884
2885 (defun gnus-group-sort-groups-by-server (&optional reverse)
2886 "Sort the group buffer alphabetically by server name.
2887 If REVERSE, sort in reverse order."
2888 (interactive "P")
2889 (gnus-group-sort-groups 'gnus-group-sort-by-server reverse))
2558 2890
2559 ;;; Selected group sorting. 2891 ;;; Selected group sorting.
2560 2892
2561 (defun gnus-group-sort-selected-groups (n func &optional reverse) 2893 (defun gnus-group-sort-selected-groups (n func &optional reverse)
2562 "Sort the process/prefixed groups." 2894 "Sort the process/prefixed groups."
2563 (interactive (list current-prefix-arg gnus-group-sort-function)) 2895 (interactive (list current-prefix-arg gnus-group-sort-function))
2564 (let ((groups (gnus-group-process-prefix n))) 2896 (let ((groups (gnus-group-process-prefix n)))
2565 (funcall gnus-group-sort-selected-function 2897 (funcall gnus-group-sort-selected-function
2566 groups (gnus-make-sort-function func) reverse) 2898 groups (gnus-make-sort-function func) reverse)
2567 (gnus-group-list-groups))) 2899 (gnus-group-unmark-all-groups)
2900 (gnus-group-list-groups)
2901 (gnus-dribble-touch)))
2568 2902
2569 (defun gnus-group-sort-selected-flat (groups func reverse) 2903 (defun gnus-group-sort-selected-flat (groups func reverse)
2570 (let (entries infos) 2904 (let (entries infos)
2571 ;; First find all the group entries for these groups. 2905 ;; First find all the group entries for these groups.
2572 (while groups 2906 (while groups
2594 Obeys the process/prefix convention. If REVERSE (the symbolic prefix), 2928 Obeys the process/prefix convention. If REVERSE (the symbolic prefix),
2595 sort in reverse order." 2929 sort in reverse order."
2596 (interactive (gnus-interactive "P\ny")) 2930 (interactive (gnus-interactive "P\ny"))
2597 (gnus-group-sort-selected-groups n 'gnus-group-sort-by-alphabet reverse)) 2931 (gnus-group-sort-selected-groups n 'gnus-group-sort-by-alphabet reverse))
2598 2932
2933 (defun gnus-group-sort-selected-groups-by-real-name (&optional n reverse)
2934 "Sort the group buffer alphabetically by real group name.
2935 Obeys the process/prefix convention. If REVERSE (the symbolic prefix),
2936 sort in reverse order."
2937 (interactive (gnus-interactive "P\ny"))
2938 (gnus-group-sort-selected-groups n 'gnus-group-sort-by-real-name reverse))
2939
2599 (defun gnus-group-sort-selected-groups-by-unread (&optional n reverse) 2940 (defun gnus-group-sort-selected-groups-by-unread (&optional n reverse)
2600 "Sort the group buffer by number of unread articles. 2941 "Sort the group buffer by number of unread articles.
2601 Obeys the process/prefix convention. If REVERSE (the symbolic prefix), 2942 Obeys the process/prefix convention. If REVERSE (the symbolic prefix),
2602 sort in reverse order." 2943 sort in reverse order."
2603 (interactive (gnus-interactive "P\ny")) 2944 (interactive (gnus-interactive "P\ny"))
2623 sort in reverse order." 2964 sort in reverse order."
2624 (interactive (gnus-interactive "P\ny")) 2965 (interactive (gnus-interactive "P\ny"))
2625 (gnus-group-sort-selected-groups n 'gnus-group-sort-by-rank reverse)) 2966 (gnus-group-sort-selected-groups n 'gnus-group-sort-by-rank reverse))
2626 2967
2627 (defun gnus-group-sort-selected-groups-by-method (&optional n reverse) 2968 (defun gnus-group-sort-selected-groups-by-method (&optional n reverse)
2628 "Sort the group buffer alphabetically by backend name. 2969 "Sort the group buffer alphabetically by back end name.
2629 Obeys the process/prefix convention. If REVERSE (the symbolic prefix), 2970 Obeys the process/prefix convention. If REVERSE (the symbolic prefix),
2630 sort in reverse order." 2971 sort in reverse order."
2631 (interactive (gnus-interactive "P\ny")) 2972 (interactive (gnus-interactive "P\ny"))
2632 (gnus-group-sort-selected-groups n 'gnus-group-sort-by-method reverse)) 2973 (gnus-group-sort-selected-groups n 'gnus-group-sort-by-method reverse))
2633 2974
2652 (defun gnus-group-sort-by-level (info1 info2) 2993 (defun gnus-group-sort-by-level (info1 info2)
2653 "Sort by level." 2994 "Sort by level."
2654 (< (gnus-info-level info1) (gnus-info-level info2))) 2995 (< (gnus-info-level info1) (gnus-info-level info2)))
2655 2996
2656 (defun gnus-group-sort-by-method (info1 info2) 2997 (defun gnus-group-sort-by-method (info1 info2)
2657 "Sort alphabetically by backend name." 2998 "Sort alphabetically by back end name."
2658 (string< (symbol-name (car (gnus-find-method-for-group 2999 (string< (car (gnus-find-method-for-group
2659 (gnus-info-group info1) info1))) 3000 (gnus-info-group info1) info1))
2660 (symbol-name (car (gnus-find-method-for-group 3001 (car (gnus-find-method-for-group
2661 (gnus-info-group info2) info2))))) 3002 (gnus-info-group info2) info2))))
3003
3004 (defun gnus-group-sort-by-server (info1 info2)
3005 "Sort alphabetically by server name."
3006 (string< (gnus-method-to-full-server-name
3007 (gnus-find-method-for-group
3008 (gnus-info-group info1) info1))
3009 (gnus-method-to-full-server-name
3010 (gnus-find-method-for-group
3011 (gnus-info-group info2) info2))))
2662 3012
2663 (defun gnus-group-sort-by-score (info1 info2) 3013 (defun gnus-group-sort-by-score (info1 info2)
2664 "Sort by group score." 3014 "Sort by group score."
2665 (< (gnus-info-score info1) (gnus-info-score info2))) 3015 (> (gnus-info-score info1) (gnus-info-score info2)))
2666 3016
2667 (defun gnus-group-sort-by-rank (info1 info2) 3017 (defun gnus-group-sort-by-rank (info1 info2)
2668 "Sort by level and score." 3018 "Sort by level and score."
2669 (let ((level1 (gnus-info-level info1)) 3019 (let ((level1 (gnus-info-level info1))
2670 (level2 (gnus-info-level info2))) 3020 (level2 (gnus-info-level info2)))
2700 "Move the cache away to avoid problems in the future? ") 3050 "Move the cache away to avoid problems in the future? ")
2701 (call-interactively 'gnus-cache-move-cache))))) 3051 (call-interactively 'gnus-cache-move-cache)))))
2702 3052
2703 (defun gnus-info-clear-data (info) 3053 (defun gnus-info-clear-data (info)
2704 "Clear all marks and read ranges from INFO." 3054 "Clear all marks and read ranges from INFO."
2705 (let ((group (gnus-info-group info))) 3055 (let ((group (gnus-info-group info))
3056 action)
3057 (dolist (el (gnus-info-marks info))
3058 (push `(,(cdr el) add (,(car el))) action))
3059 (push `(,(gnus-info-read info) add (read)) action)
2706 (gnus-undo-register 3060 (gnus-undo-register
2707 `(progn 3061 `(progn
3062 (gnus-request-set-mark ,group ',action)
2708 (gnus-info-set-marks ',info ',(gnus-info-marks info) t) 3063 (gnus-info-set-marks ',info ',(gnus-info-marks info) t)
2709 (gnus-info-set-read ',info ',(gnus-info-read info)) 3064 (gnus-info-set-read ',info ',(gnus-info-read info))
2710 (when (gnus-group-goto-group ,group) 3065 (when (gnus-group-goto-group ,group)
3066 (gnus-get-unread-articles-in-group ',info ',(gnus-active group) t)
2711 (gnus-group-update-group-line)))) 3067 (gnus-group-update-group-line))))
3068 (setq action (mapcar (lambda (el) (list (nth 0 el) 'del (nth 2 el)))
3069 action))
3070 (gnus-request-set-mark group action)
2712 (gnus-info-set-read info nil) 3071 (gnus-info-set-read info nil)
2713 (when (gnus-info-marks info) 3072 (when (gnus-info-marks info)
2714 (gnus-info-set-marks info nil)))) 3073 (gnus-info-set-marks info nil))))
2715 3074
2716 ;; Group catching up. 3075 ;; Group catching up.
2766 "Mark all articles in GROUP as read. 3125 "Mark all articles in GROUP as read.
2767 If ALL is non-nil, all articles are marked as read. 3126 If ALL is non-nil, all articles are marked as read.
2768 The return value is the number of articles that were marked as read, 3127 The return value is the number of articles that were marked as read,
2769 or nil if no action could be taken." 3128 or nil if no action could be taken."
2770 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb)) 3129 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb))
2771 (num (car entry))) 3130 (num (car entry))
3131 (marks (nth 3 (nth 2 entry)))
3132 (unread (gnus-list-of-unread-articles group)))
2772 ;; Remove entries for this group. 3133 ;; Remove entries for this group.
2773 (nnmail-purge-split-history (gnus-group-real-name group)) 3134 (nnmail-purge-split-history (gnus-group-real-name group))
2774 ;; Do the updating only if the newsgroup isn't killed. 3135 ;; Do the updating only if the newsgroup isn't killed.
2775 (if (not (numberp (car entry))) 3136 (if (not (numberp (car entry)))
2776 (gnus-message 1 "Can't catch up %s; non-active group" group) 3137 (gnus-message 1 "Can't catch up %s; non-active group" group)
3138 (gnus-update-read-articles group nil)
3139 (when all
3140 ;; Nix out the lists of marks and dormants.
3141 (gnus-request-set-mark group (list (list (cdr (assq 'tick marks))
3142 'del '(tick))
3143 (list (cdr (assq 'dormant marks))
3144 'del '(dormant))))
3145 (setq unread (gnus-uncompress-range
3146 (gnus-range-add (gnus-range-add
3147 unread (cdr (assq 'dormant marks)))
3148 (cdr (assq 'tick marks)))))
3149 (gnus-add-marked-articles group 'tick nil nil 'force)
3150 (gnus-add-marked-articles group 'dormant nil nil 'force))
2777 ;; Do auto-expirable marks if that's required. 3151 ;; Do auto-expirable marks if that's required.
2778 (when (gnus-group-auto-expirable-p group) 3152 (when (gnus-group-auto-expirable-p group)
2779 (gnus-add-marked-articles 3153 (gnus-add-marked-articles group 'expire unread)
2780 group 'expire (gnus-list-of-unread-articles group)) 3154 (gnus-request-set-mark group (list (list unread 'add '(expire)))))
2781 (when all 3155 (let ((gnus-newsgroup-name group))
2782 (let ((marks (nth 3 (nth 2 entry)))) 3156 (gnus-run-hooks 'gnus-group-catchup-group-hook))
2783 (gnus-add-marked-articles 3157 num)))
2784 group 'expire (gnus-uncompress-range (cdr (assq 'tick marks))))
2785 (gnus-add-marked-articles
2786 group 'expire (gnus-uncompress-range (cdr (assq 'tick marks)))))))
2787 (when entry
2788 (gnus-update-read-articles group nil)
2789 ;; Also nix out the lists of marks and dormants.
2790 (when all
2791 (gnus-add-marked-articles group 'tick nil nil 'force)
2792 (gnus-add-marked-articles group 'dormant nil nil 'force))
2793 (let ((gnus-newsgroup-name group))
2794 (gnus-run-hooks 'gnus-group-catchup-group-hook))
2795 num))))
2796 3158
2797 (defun gnus-group-expire-articles (&optional n) 3159 (defun gnus-group-expire-articles (&optional n)
2798 "Expire all expirable articles in the current newsgroup." 3160 "Expire all expirable articles in the current newsgroup.
3161 Uses the process/prefix convention."
2799 (interactive "P") 3162 (interactive "P")
2800 (let ((groups (gnus-group-process-prefix n)) 3163 (let ((groups (gnus-group-process-prefix n))
2801 group) 3164 group)
2802 (unless groups 3165 (unless groups
2803 (error "No groups to expire")) 3166 (error "No groups to expire"))
2852 (defun gnus-group-set-current-level (n level) 3215 (defun gnus-group-set-current-level (n level)
2853 "Set the level of the next N groups to LEVEL." 3216 "Set the level of the next N groups to LEVEL."
2854 (interactive 3217 (interactive
2855 (list 3218 (list
2856 current-prefix-arg 3219 current-prefix-arg
2857 (string-to-int 3220 (progn
2858 (let ((s (read-string 3221 (unless (gnus-group-process-prefix current-prefix-arg)
2859 (format "Level (default %s): " 3222 (error "No group on the current line"))
2860 (or (gnus-group-group-level) 3223 (string-to-int
2861 gnus-level-default-subscribed))))) 3224 (let ((s (read-string
2862 (if (string-match "^\\s-*$" s) 3225 (format "Level (default %s): "
2863 (int-to-string (or (gnus-group-group-level) 3226 (or (gnus-group-group-level)
2864 gnus-level-default-subscribed)) 3227 gnus-level-default-subscribed)))))
2865 s))))) 3228 (if (string-match "^\\s-*$" s)
3229 (int-to-string (or (gnus-group-group-level)
3230 gnus-level-default-subscribed))
3231 s))))))
2866 (unless (and (>= level 1) (<= level gnus-level-killed)) 3232 (unless (and (>= level 1) (<= level gnus-level-killed))
2867 (error "Invalid level: %d" level)) 3233 (error "Invalid level: %d" level))
2868 (let ((groups (gnus-group-process-prefix n)) 3234 (let ((groups (gnus-group-process-prefix n))
2869 group) 3235 group)
2870 (while (setq group (pop groups)) 3236 (while (setq group (pop groups))
2889 3255
2890 (defun gnus-group-unsubscribe-current-group (&optional n do-sub) 3256 (defun gnus-group-unsubscribe-current-group (&optional n do-sub)
2891 "Toggle subscription of the current group. 3257 "Toggle subscription of the current group.
2892 If given numerical prefix, toggle the N next groups." 3258 If given numerical prefix, toggle the N next groups."
2893 (interactive "P") 3259 (interactive "P")
2894 (let ((groups (gnus-group-process-prefix n)) 3260 (dolist (group (gnus-group-process-prefix n))
2895 group) 3261 (gnus-group-remove-mark group)
2896 (while groups 3262 (gnus-group-unsubscribe-group
2897 (setq group (car groups) 3263 group
2898 groups (cdr groups)) 3264 (cond
2899 (gnus-group-remove-mark group) 3265 ((eq do-sub 'unsubscribe)
2900 (gnus-group-unsubscribe-group 3266 gnus-level-default-unsubscribed)
2901 group 3267 ((eq do-sub 'subscribe)
2902 (cond 3268 gnus-level-default-subscribed)
2903 ((eq do-sub 'unsubscribe) 3269 ((<= (gnus-group-group-level) gnus-level-subscribed)
2904 gnus-level-default-unsubscribed) 3270 gnus-level-default-unsubscribed)
2905 ((eq do-sub 'subscribe) 3271 (t
2906 gnus-level-default-subscribed) 3272 gnus-level-default-subscribed))
2907 ((<= (gnus-group-group-level) gnus-level-subscribed) 3273 t)
2908 gnus-level-default-unsubscribed) 3274 (gnus-group-update-group-line))
2909 (t 3275 (gnus-group-next-group 1))
2910 gnus-level-default-subscribed))
2911 t)
2912 (gnus-group-update-group-line))
2913 (gnus-group-next-group 1)))
2914 3276
2915 (defun gnus-group-unsubscribe-group (group &optional level silent) 3277 (defun gnus-group-unsubscribe-group (group &optional level silent)
2916 "Toggle subscription to GROUP. 3278 "Toggle subscription to GROUP.
2917 Killed newsgroups are subscribed. If SILENT, don't try to update the 3279 Killed newsgroups are subscribed. If SILENT, don't try to update the
2918 group line." 3280 group line."
3024 (gnus-group-change-level 3386 (gnus-group-change-level
3025 (if entry entry group) gnus-level-killed (if entry nil level)) 3387 (if entry entry group) gnus-level-killed (if entry nil level))
3026 (message "Killed group %s" group)) 3388 (message "Killed group %s" group))
3027 ;; If there are lots and lots of groups to be killed, we use 3389 ;; If there are lots and lots of groups to be killed, we use
3028 ;; this thing instead. 3390 ;; this thing instead.
3029 (let (entry) 3391 (dolist (group (nreverse groups))
3030 (setq groups (nreverse groups)) 3392 (gnus-group-remove-mark group)
3031 (while groups 3393 (gnus-delete-line)
3032 (gnus-group-remove-mark (setq group (pop groups))) 3394 (push group gnus-killed-list)
3033 (gnus-delete-line) 3395 (setq gnus-newsrc-alist
3034 (push group gnus-killed-list) 3396 (delq (assoc group gnus-newsrc-alist)
3035 (setq gnus-newsrc-alist 3397 gnus-newsrc-alist))
3036 (delq (assoc group gnus-newsrc-alist) 3398 (when gnus-group-change-level-function
3037 gnus-newsrc-alist)) 3399 (funcall gnus-group-change-level-function
3038 (when gnus-group-change-level-function 3400 group gnus-level-killed 3))
3039 (funcall gnus-group-change-level-function 3401 (cond
3040 group gnus-level-killed 3)) 3402 ((setq entry (gnus-gethash group gnus-newsrc-hashtb))
3041 (cond 3403 (push (cons (car entry) (nth 2 entry))
3042 ((setq entry (gnus-gethash group gnus-newsrc-hashtb)) 3404 gnus-list-of-killed-groups)
3043 (push (cons (car entry) (nth 2 entry)) 3405 (setcdr (cdr entry) (cdddr entry)))
3044 gnus-list-of-killed-groups) 3406 ((member group gnus-zombie-list)
3045 (setcdr (cdr entry) (cdddr entry))) 3407 (setq gnus-zombie-list (delete group gnus-zombie-list))))
3046 ((member group gnus-zombie-list) 3408 ;; There may be more than one instance displayed.
3047 (setq gnus-zombie-list (delete group gnus-zombie-list)))) 3409 (while (gnus-group-goto-group group)
3048 ;; There may be more than one instance displayed. 3410 (gnus-delete-line)))
3049 (while (gnus-group-goto-group group) 3411 (gnus-make-hashtable-from-newsrc-alist))
3050 (gnus-delete-line)))
3051 (gnus-make-hashtable-from-newsrc-alist)))
3052 3412
3053 (gnus-group-position-point) 3413 (gnus-group-position-point)
3054 (if (< (length out) 2) (car out) (nreverse out)))) 3414 (if (< (length out) 2) (car out) (nreverse out))))
3055 3415
3056 (defun gnus-group-yank-group (&optional arg) 3416 (defun gnus-group-yank-group (&optional arg)
3111 (t 3471 (t
3112 (error "Can't kill; invalid level: %d" level)))) 3472 (error "Can't kill; invalid level: %d" level))))
3113 3473
3114 (defun gnus-group-list-all-groups (&optional arg) 3474 (defun gnus-group-list-all-groups (&optional arg)
3115 "List all newsgroups with level ARG or lower. 3475 "List all newsgroups with level ARG or lower.
3116 Default is gnus-level-unsubscribed, which lists all subscribed and most 3476 Default is `gnus-level-unsubscribed', which lists all subscribed and most
3117 unsubscribed groups." 3477 unsubscribed groups."
3118 (interactive "P") 3478 (interactive "P")
3119 (gnus-group-list-groups (or arg gnus-level-unsubscribed) t)) 3479 (gnus-group-list-groups (or arg gnus-level-unsubscribed) t))
3120 3480
3121 ;; Redefine this to list ALL killed groups if prefix arg used. 3481 ;; Redefine this to list ALL killed groups if prefix arg used.
3173 (while groups 3533 (while groups
3174 (setq group (pop groups)) 3534 (setq group (pop groups))
3175 (gnus-add-text-properties 3535 (gnus-add-text-properties
3176 (point) (prog1 (1+ (point)) 3536 (point) (prog1 (1+ (point))
3177 (insert " *: " 3537 (insert " *: "
3178 (gnus-group-name-decode group 3538 (gnus-group-decoded-name group)
3179 (gnus-group-name-charset
3180 nil group))
3181 "\n")) 3539 "\n"))
3182 (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb) 3540 (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
3183 'gnus-unread t 3541 'gnus-unread t
3184 'gnus-level (inline (gnus-group-level group))))) 3542 'gnus-level (inline (gnus-group-level group)))))
3185 (goto-char (point-min)))) 3543 (goto-char (point-min))))
3200 (require 'nnmail) 3558 (require 'nnmail)
3201 (let ((gnus-inhibit-demon t) 3559 (let ((gnus-inhibit-demon t)
3202 ;; Binding this variable will inhibit multiple fetchings 3560 ;; Binding this variable will inhibit multiple fetchings
3203 ;; of the same mail source. 3561 ;; of the same mail source.
3204 (nnmail-fetched-sources (list t))) 3562 (nnmail-fetched-sources (list t)))
3563 (gnus-run-hooks 'gnus-get-top-new-news-hook)
3205 (gnus-run-hooks 'gnus-get-new-news-hook) 3564 (gnus-run-hooks 'gnus-get-new-news-hook)
3206 3565
3207 ;; Read any slave files. 3566 ;; Read any slave files.
3208 (unless gnus-slave 3567 (unless gnus-slave
3209 (gnus-master-read-slave-newsrc)) 3568 (gnus-master-read-slave-newsrc))
3298 (if (not (file-exists-p file)) 3657 (if (not (file-exists-p file))
3299 (gnus-message 1 "No such file: %s" file) 3658 (gnus-message 1 "No such file: %s" file)
3300 (let ((enable-local-variables nil)) 3659 (let ((enable-local-variables nil))
3301 (find-file file) 3660 (find-file file)
3302 (setq found t)))))) 3661 (setq found t))))))
3662
3663 (defun gnus-group-fetch-charter (group)
3664 "Fetch the charter for the current group.
3665 If given a prefix argument, prompt for a group."
3666 (interactive
3667 (list (or (when current-prefix-arg
3668 (completing-read "Group: " gnus-active-hashtb))
3669 (gnus-group-group-name)
3670 gnus-newsgroup-name)))
3671 (unless group
3672 (error "No group name given"))
3673 (require 'mm-url)
3674 (condition-case nil (require 'url-http) (error nil))
3675 (let ((name (mm-url-form-encode-xwfu (gnus-group-real-name group)))
3676 url hierarchy)
3677 (when (string-match "\\(^[^\\.]+\\)\\..*" name)
3678 (setq hierarchy (match-string 1 name))
3679 (if (and (setq url (cdr (assoc hierarchy gnus-group-charter-alist)))
3680 (if (fboundp 'url-http-file-exists-p)
3681 (url-http-file-exists-p (eval url))
3682 t))
3683 (browse-url (eval url))
3684 (setq url (concat "http://" hierarchy
3685 ".news-admin.org/charters/" name))
3686 (if (and (fboundp 'url-http-file-exists-p)
3687 (url-http-file-exists-p url))
3688 (browse-url url)
3689 (gnus-group-fetch-control group))))))
3690
3691 (defun gnus-group-fetch-control (group)
3692 "Fetch the archived control messages for the current group.
3693 If given a prefix argument, prompt for a group."
3694 (interactive
3695 (list (or (when current-prefix-arg
3696 (completing-read "Group: " gnus-active-hashtb))
3697 (gnus-group-group-name)
3698 gnus-newsgroup-name)))
3699 (unless group
3700 (error "No group name given"))
3701 (let ((name (gnus-group-real-name group))
3702 hierarchy)
3703 (when (string-match "\\(^[^\\.]+\\)\\..*" name)
3704 (setq hierarchy (match-string 1 name))
3705 (if gnus-group-fetch-control-use-browse-url
3706 (browse-url (concat "ftp://ftp.isc.org/usenet/control/"
3707 hierarchy "/" name ".gz"))
3708 (let ((enable-local-variables nil))
3709 (gnus-group-read-ephemeral-group
3710 group
3711 `(nndoc ,group (nndoc-address
3712 ,(find-file-noselect
3713 (concat "/ftp@ftp.isc.org:/usenet/control/"
3714 hierarchy "/" name ".gz")))
3715 (nndoc-article-type mbox)) t nil nil))))))
3303 3716
3304 (defun gnus-group-describe-group (force &optional group) 3717 (defun gnus-group-describe-group (force &optional group)
3305 "Display a description of the current newsgroup." 3718 "Display a description of the current newsgroup."
3306 (interactive (list current-prefix-arg (gnus-group-group-name))) 3719 (interactive (list current-prefix-arg (gnus-group-group-name)))
3307 (let* ((method (gnus-find-method-for-group group)) 3720 (let* ((method (gnus-find-method-for-group group))
3394 (setq groups (cdr groups))) 3807 (setq groups (cdr groups)))
3395 (goto-char (point-min)))) 3808 (goto-char (point-min))))
3396 (pop-to-buffer obuf))) 3809 (pop-to-buffer obuf)))
3397 3810
3398 (defun gnus-group-description-apropos (regexp) 3811 (defun gnus-group-description-apropos (regexp)
3399 "List all newsgroups that have names or descriptions that match a regexp." 3812 "List all newsgroups that have names or descriptions that match REGEXP."
3400 (interactive "sGnus description apropos (regexp): ") 3813 (interactive "sGnus description apropos (regexp): ")
3401 (when (not (or gnus-description-hashtb 3814 (when (not (or gnus-description-hashtb
3402 (gnus-read-all-descriptions-files))) 3815 (gnus-read-all-descriptions-files)))
3403 (error "Couldn't request descriptions file")) 3816 (error "Couldn't request descriptions file"))
3404 (gnus-group-apropos regexp t)) 3817 (gnus-group-apropos regexp t))
3415 (interactive "P\nsList newsgroups matching: ") 3828 (interactive "P\nsList newsgroups matching: ")
3416 ;; First make sure active file has been read. 3829 ;; First make sure active file has been read.
3417 (when (and level 3830 (when (and level
3418 (> (prefix-numeric-value level) gnus-level-killed)) 3831 (> (prefix-numeric-value level) gnus-level-killed))
3419 (gnus-get-killed-groups)) 3832 (gnus-get-killed-groups))
3420 (gnus-group-prepare-flat 3833 (funcall gnus-group-prepare-function
3421 (or level gnus-level-subscribed) all (or lowest 1) regexp) 3834 (or level gnus-level-subscribed) (and all t) (or lowest 1) regexp)
3422 (goto-char (point-min)) 3835 (goto-char (point-min))
3423 (gnus-group-position-point)) 3836 (gnus-group-position-point))
3424 3837
3425 (defun gnus-group-list-all-matching (level regexp &optional lowest) 3838 (defun gnus-group-list-all-matching (level regexp &optional lowest)
3426 "List all groups that match REGEXP. 3839 "List all groups that match REGEXP.
3493 (defun gnus-group-force-update () 3906 (defun gnus-group-force-update ()
3494 "Update `.newsrc' file." 3907 "Update `.newsrc' file."
3495 (interactive) 3908 (interactive)
3496 (gnus-save-newsrc-file)) 3909 (gnus-save-newsrc-file))
3497 3910
3911 (defvar gnus-backlog-articles)
3912
3498 (defun gnus-group-suspend () 3913 (defun gnus-group-suspend ()
3499 "Suspend the current Gnus session. 3914 "Suspend the current Gnus session.
3500 In fact, cleanup buffers except for group mode buffer. 3915 In fact, cleanup buffers except for group mode buffer.
3501 The hook gnus-suspend-gnus-hook is called before actually suspending." 3916 The hook `gnus-suspend-gnus-hook' is called before actually suspending."
3502 (interactive) 3917 (interactive)
3503 (gnus-run-hooks 'gnus-suspend-gnus-hook) 3918 (gnus-run-hooks 'gnus-suspend-gnus-hook)
3919 (gnus-offer-save-summaries)
3504 ;; Kill Gnus buffers except for group mode buffer. 3920 ;; Kill Gnus buffers except for group mode buffer.
3505 (let ((group-buf (get-buffer gnus-group-buffer))) 3921 (let ((group-buf (get-buffer gnus-group-buffer)))
3506 (dolist (buf (gnus-buffers)) 3922 (mapcar (lambda (buf)
3507 (unless (or (eq buf group-buf) (eq buf gnus-dribble-buffer)) 3923 (unless (or (member buf (list group-buf gnus-dribble-buffer))
3508 (kill-buffer buf))) 3924 (progn
3925 (save-excursion
3926 (set-buffer buf)
3927 (eq major-mode 'message-mode))))
3928 (gnus-kill-buffer buf)))
3929 (gnus-buffers))
3930 (setq gnus-backlog-articles nil)
3509 (gnus-kill-gnus-frames) 3931 (gnus-kill-gnus-frames)
3510 (when group-buf 3932 (when group-buf
3511 (bury-buffer group-buf) 3933 (bury-buffer group-buf)
3512 (delete-windows-on group-buf t)))) 3934 (delete-windows-on group-buf t))))
3513 3935
3550 (gnus-yes-or-no-p 3972 (gnus-yes-or-no-p
3551 (format "Quit reading news without saving %s? " 3973 (format "Quit reading news without saving %s? "
3552 (file-name-nondirectory gnus-current-startup-file)))) 3974 (file-name-nondirectory gnus-current-startup-file))))
3553 (gnus-run-hooks 'gnus-exit-gnus-hook) 3975 (gnus-run-hooks 'gnus-exit-gnus-hook)
3554 (gnus-configure-windows 'group t) 3976 (gnus-configure-windows 'group t)
3977 (when (and (gnus-buffer-live-p gnus-dribble-buffer)
3978 (not (zerop (save-excursion
3979 (set-buffer gnus-dribble-buffer)
3980 (buffer-size)))))
3981 (gnus-dribble-enter
3982 ";;; Gnus was exited on purpose without saving the .newsrc files."))
3555 (gnus-dribble-save) 3983 (gnus-dribble-save)
3556 (gnus-close-backends) 3984 (gnus-close-backends)
3557 (gnus-clear-system) 3985 (gnus-clear-system)
3558 (gnus-kill-buffer gnus-group-buffer) 3986 (gnus-kill-buffer gnus-group-buffer)
3559 ;; Allow the user to do things after cleaning up. 3987 ;; Allow the user to do things after cleaning up.
3570 (nntp, nnspool, etc.) and a server address (eg. nntp.some.where). 3998 (nntp, nnspool, etc.) and a server address (eg. nntp.some.where).
3571 If not, METHOD should be a list where the first element is the method 3999 If not, METHOD should be a list where the first element is the method
3572 and the second element is the address." 4000 and the second element is the address."
3573 (interactive 4001 (interactive
3574 (list (let ((how (completing-read 4002 (list (let ((how (completing-read
3575 "Which backend: " 4003 "Which back end: "
3576 (append gnus-valid-select-methods gnus-server-alist) 4004 (append gnus-valid-select-methods gnus-server-alist)
3577 nil t (cons "nntp" 0) 'gnus-method-history))) 4005 nil t (cons "nntp" 0) 'gnus-method-history)))
3578 ;; We either got a backend name or a virtual server name. 4006 ;; We either got a back end name or a virtual server name.
3579 ;; If the first, we also need an address. 4007 ;; If the first, we also need an address.
3580 (if (assoc how gnus-valid-select-methods) 4008 (if (assoc how gnus-valid-select-methods)
3581 (list (intern how) 4009 (list (intern how)
3582 ;; Suggested by mapjph@bath.ac.uk. 4010 ;; Suggested by mapjph@bath.ac.uk.
3583 (completing-read 4011 (completing-read
3639 (if entry 4067 (if entry
3640 (progn 4068 (progn
3641 (setcar (nthcdr 2 entry) info) 4069 (setcar (nthcdr 2 entry) info)
3642 (when (and (not (eq (car entry) t)) 4070 (when (and (not (eq (car entry) t))
3643 (gnus-active (gnus-info-group info))) 4071 (gnus-active (gnus-info-group info)))
3644 (setcar entry (length (gnus-list-of-unread-articles (car info)))))) 4072 (setcar entry (length
4073 (gnus-list-of-unread-articles (car info))))))
3645 (error "No such group: %s" (gnus-info-group info)))))) 4074 (error "No such group: %s" (gnus-info-group info))))))
3646 4075
3647 (defun gnus-group-set-method-info (group select-method) 4076 (defun gnus-group-set-method-info (group select-method)
3648 (gnus-group-set-info select-method group 'method)) 4077 (gnus-group-set-info select-method group 'method))
3649 4078
3674 (setcdr m (gnus-compress-sequence articles t))) 4103 (setcdr m (gnus-compress-sequence articles t)))
3675 (setcdr m (gnus-compress-sequence 4104 (setcdr m (gnus-compress-sequence
3676 (sort (nconc (gnus-uncompress-range (cdr m)) 4105 (sort (nconc (gnus-uncompress-range (cdr m))
3677 (copy-sequence articles)) '<) t)))))) 4106 (copy-sequence articles)) '<) t))))))
3678 4107
4108 (defun gnus-add-mark (group mark article)
4109 "Mark ARTICLE in GROUP with MARK, whether the group is displayed or not."
4110 (let ((buffer (gnus-summary-buffer-name group)))
4111 (if (gnus-buffer-live-p buffer)
4112 (save-excursion
4113 (set-buffer (get-buffer buffer))
4114 (gnus-summary-add-mark article mark))
4115 (gnus-add-marked-articles group (cdr (assq mark gnus-article-mark-lists))
4116 (list article)))))
4117
3679 ;;; 4118 ;;;
3680 ;;; Group timestamps 4119 ;;; Group timestamps
3681 ;;; 4120 ;;;
3682 4121
3683 (defun gnus-group-set-timestamp () 4122 (defun gnus-group-set-timestamp ()
3695 4134
3696 (defun gnus-group-timestamp-delta (group) 4135 (defun gnus-group-timestamp-delta (group)
3697 "Return the offset in seconds from the timestamp for GROUP to the current time, as a floating point number." 4136 "Return the offset in seconds from the timestamp for GROUP to the current time, as a floating point number."
3698 (let* ((time (or (gnus-group-timestamp group) 4137 (let* ((time (or (gnus-group-timestamp group)
3699 (list 0 0))) 4138 (list 0 0)))
3700 (delta (subtract-time (current-time) time))) 4139 (delta (subtract-time (current-time) time)))
3701 (+ (* (nth 0 delta) 65536.0) 4140 (+ (* (nth 0 delta) 65536.0)
3702 (nth 1 delta)))) 4141 (nth 1 delta))))
3703 4142
3704 (defun gnus-group-timestamp-string (group) 4143 (defun gnus-group-timestamp-string (group)
3705 "Return a string of the timestamp for GROUP." 4144 "Return a string of the timestamp for GROUP."
3706 (let ((time (gnus-group-timestamp group))) 4145 (let ((time (gnus-group-timestamp group)))
3707 (if (not time) 4146 (if (not time)
3708 "" 4147 ""
3709 (gnus-time-iso8601 time)))) 4148 (gnus-time-iso8601 time))))
3710 4149
3711 (defun gnus-group-prepare-flat-list-dead-predicate
3712 (groups level mark predicate)
3713 (let (group)
3714 (if predicate
3715 ;; This loop is used when listing groups that match some
3716 ;; regexp.
3717 (while (setq group (pop groups))
3718 (when (funcall predicate group)
3719 (gnus-add-text-properties
3720 (point) (prog1 (1+ (point))
3721 (insert " " mark " *: "
3722 (gnus-group-name-decode group
3723 (gnus-group-name-charset
3724 nil group))
3725 "\n"))
3726 (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
3727 'gnus-unread t
3728 'gnus-level level)))))))
3729
3730 (defun gnus-group-prepare-flat-predicate (level predicate &optional lowest
3731 dead-predicate)
3732 "List all newsgroups with unread articles of level LEVEL or lower.
3733 If LOWEST is non-nil, list all newsgroups of level LOWEST or higher.
3734 If PREDICATE, only list groups which PREDICATE returns non-nil.
3735 If DEAD-PREDICATE, list dead groups which DEAD-PREDICATE returns non-nil."
3736 (set-buffer gnus-group-buffer)
3737 (let ((buffer-read-only nil)
3738 (newsrc (cdr gnus-newsrc-alist))
3739 (lowest (or lowest 1))
3740 info clevel unread group params)
3741 (erase-buffer)
3742 ;; List living groups.
3743 (while newsrc
3744 (setq info (car newsrc)
3745 group (gnus-info-group info)
3746 params (gnus-info-params info)
3747 newsrc (cdr newsrc)
3748 unread (car (gnus-gethash group gnus-newsrc-hashtb)))
3749 (and unread ; This group might be unchecked
3750 (funcall predicate info)
3751 (<= (setq clevel (gnus-info-level info)) level)
3752 (>= clevel lowest)
3753 (gnus-group-insert-group-line
3754 group (gnus-info-level info)
3755 (gnus-info-marks info) unread (gnus-info-method info))))
3756
3757 ;; List dead groups.
3758 (and (>= level gnus-level-zombie) (<= lowest gnus-level-zombie)
3759 (gnus-group-prepare-flat-list-dead-predicate
3760 (setq gnus-zombie-list (sort gnus-zombie-list 'string<))
3761 gnus-level-zombie ?Z
3762 dead-predicate))
3763 (and (>= level gnus-level-killed) (<= lowest gnus-level-killed)
3764 (gnus-group-prepare-flat-list-dead-predicate
3765 (setq gnus-killed-list (sort gnus-killed-list 'string<))
3766 gnus-level-killed ?K dead-predicate))
3767
3768 (gnus-group-set-mode-line)
3769 (setq gnus-group-list-mode (cons level t))
3770 (gnus-run-hooks 'gnus-group-prepare-hook)
3771 t))
3772
3773 (defun gnus-group-list-cached (level &optional lowest) 4150 (defun gnus-group-list-cached (level &optional lowest)
3774 "List all groups with cached articles. 4151 "List all groups with cached articles.
3775 If the prefix LEVEL is non-nil, it should be a number that says which 4152 If the prefix LEVEL is non-nil, it should be a number that says which
3776 level to cut off listing groups. 4153 level to cut off listing groups.
3777 If LOWEST, don't list groups with level lower than LOWEST. 4154 If LOWEST, don't list groups with level lower than LOWEST.
3780 (interactive "P") 4157 (interactive "P")
3781 (when level 4158 (when level
3782 (setq level (prefix-numeric-value level))) 4159 (setq level (prefix-numeric-value level)))
3783 (when (or (not level) (>= level gnus-level-zombie)) 4160 (when (or (not level) (>= level gnus-level-zombie))
3784 (gnus-cache-open)) 4161 (gnus-cache-open))
3785 (gnus-group-prepare-flat-predicate (or level gnus-level-subscribed) 4162 (funcall gnus-group-prepare-function
3786 #'(lambda (info) 4163 (or level gnus-level-subscribed)
3787 (let ((marks (gnus-info-marks info))) 4164 #'(lambda (info)
3788 (assq 'cache marks))) 4165 (let ((marks (gnus-info-marks info)))
3789 lowest 4166 (assq 'cache marks)))
3790 #'(lambda (group) 4167 lowest
3791 (or (gnus-gethash group 4168 #'(lambda (group)
3792 gnus-cache-active-hashtb) 4169 (or (gnus-gethash group
3793 ;; Cache active file might use "." 4170 gnus-cache-active-hashtb)
3794 ;; instead of ":". 4171 ;; Cache active file might use "."
3795 (gnus-gethash 4172 ;; instead of ":".
3796 (mapconcat 'identity 4173 (gnus-gethash
3797 (split-string group ":") 4174 (mapconcat 'identity
3798 ".") 4175 (split-string group ":")
3799 gnus-cache-active-hashtb)))) 4176 ".")
4177 gnus-cache-active-hashtb))))
3800 (goto-char (point-min)) 4178 (goto-char (point-min))
3801 (gnus-group-position-point)) 4179 (gnus-group-position-point))
3802 4180
3803 (defun gnus-group-list-dormant (level &optional lowest) 4181 (defun gnus-group-list-dormant (level &optional lowest)
3804 "List all groups with dormant articles. 4182 "List all groups with dormant articles.
3810 (interactive "P") 4188 (interactive "P")
3811 (when level 4189 (when level
3812 (setq level (prefix-numeric-value level))) 4190 (setq level (prefix-numeric-value level)))
3813 (when (or (not level) (>= level gnus-level-zombie)) 4191 (when (or (not level) (>= level gnus-level-zombie))
3814 (gnus-cache-open)) 4192 (gnus-cache-open))
3815 (gnus-group-prepare-flat-predicate (or level gnus-level-subscribed) 4193 (funcall gnus-group-prepare-function
3816 #'(lambda (info) 4194 (or level gnus-level-subscribed)
3817 (let ((marks (gnus-info-marks info))) 4195 #'(lambda (info)
3818 (assq 'dormant marks))) 4196 (let ((marks (gnus-info-marks info)))
3819 lowest) 4197 (assq 'dormant marks)))
4198 lowest
4199 'ignore)
3820 (goto-char (point-min)) 4200 (goto-char (point-min))
3821 (gnus-group-position-point)) 4201 (gnus-group-position-point))
3822 4202
4203 (defun gnus-group-listed-groups ()
4204 "Return a list of listed groups."
4205 (let (point groups)
4206 (goto-char (point-min))
4207 (while (setq point (text-property-not-all (point) (point-max)
4208 'gnus-group nil))
4209 (goto-char point)
4210 (push (symbol-name (get-text-property point 'gnus-group)) groups)
4211 (forward-char 1))
4212 groups))
4213
4214 (defun gnus-group-list-plus (&optional args)
4215 "List groups plus the current selection."
4216 (interactive "P")
4217 (let ((gnus-group-listed-groups (gnus-group-listed-groups))
4218 (gnus-group-list-mode gnus-group-list-mode) ;; Save it.
4219 func)
4220 (push last-command-event unread-command-events)
4221 (if (featurep 'xemacs)
4222 (push (make-event 'key-press '(key ?A)) unread-command-events)
4223 (push ?A unread-command-events))
4224 (let (gnus-pick-mode keys)
4225 (setq keys (if (featurep 'xemacs)
4226 (events-to-keys (read-key-sequence nil))
4227 (read-key-sequence nil)))
4228 (setq func (lookup-key (current-local-map) keys)))
4229 (if (or (not func)
4230 (numberp func))
4231 (ding)
4232 (call-interactively func))))
4233
4234 (defun gnus-group-list-flush (&optional args)
4235 "Flush groups from the current selection."
4236 (interactive "P")
4237 (let ((gnus-group-list-option 'flush))
4238 (gnus-group-list-plus args)))
4239
4240 (defun gnus-group-list-limit (&optional args)
4241 "List groups limited within the current selection."
4242 (interactive "P")
4243 (let ((gnus-group-list-option 'limit))
4244 (gnus-group-list-plus args)))
4245
4246 (defun gnus-group-mark-article-read (group article)
4247 "Mark ARTICLE read."
4248 (let ((buffer (gnus-summary-buffer-name group))
4249 (mark gnus-read-mark)
4250 active n)
4251 (if (get-buffer buffer)
4252 (with-current-buffer buffer
4253 (setq active gnus-newsgroup-active)
4254 (gnus-activate-group group)
4255 (when gnus-newsgroup-prepared
4256 (when (and gnus-newsgroup-auto-expire
4257 (memq mark gnus-auto-expirable-marks))
4258 (setq mark gnus-expirable-mark))
4259 (setq mark (gnus-request-update-mark
4260 group article mark))
4261 (gnus-mark-article-as-read article mark)
4262 (setq gnus-newsgroup-active (gnus-active group))
4263 (when active
4264 (setq n (1+ (cdr active)))
4265 (while (<= n (cdr gnus-newsgroup-active))
4266 (unless (eq n article)
4267 (push n gnus-newsgroup-unselected))
4268 (setq n (1+ n)))
4269 (setq gnus-newsgroup-unselected
4270 (nreverse gnus-newsgroup-unselected)))))
4271 (gnus-activate-group group)
4272 (gnus-group-make-articles-read group (list article))
4273 (when (gnus-group-auto-expirable-p group)
4274 (gnus-add-marked-articles
4275 group 'expire (list article))))))
4276
3823 (provide 'gnus-group) 4277 (provide 'gnus-group)
3824 4278
3825 ;;; arch-tag: 2eb5440f-0bca-4091-814c-e37817536af6 4279 ;;; arch-tag: 2eb5440f-0bca-4091-814c-e37817536af6
3826 ;;; gnus-group.el ends here 4280 ;;; gnus-group.el ends here