mirrored from git://git.sv.gnu.org/emacs.git
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
gnus-group.el
4869 lines (4494 loc) · 178 KB
/
gnus-group.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;; gnus-group.el --- group mode commands for Gnus -*- lexical-binding: t; -*-
;; Copyright (C) 1996-2024 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(require 'cl-lib)
(require 'gnus)
(require 'gnus-start)
(require 'nnmail)
(require 'gnus-spec)
(require 'gnus-int)
(require 'gnus-range)
(require 'gnus-win)
(require 'gnus-undo)
(require 'gmm-utils)
(require 'time-date)
(require 'range)
(eval-when-compile
(require 'mm-url)
(require 'subr-x)
(with-suppressed-warnings ((lexical features))
(dlet ((features (cons 'gnus-group features)))
(require 'gnus-sum))))
(defvar gnus-cache-active-hashtb)
(defvar tool-bar-mode)
(autoload 'gnus-agent-total-fetched-for "gnus-agent")
(autoload 'gnus-cache-total-fetched-for "gnus-cache")
(autoload 'gnus-cloud-upload-all-data "gnus-cloud")
(autoload 'gnus-cloud-download-all-data "gnus-cloud")
(autoload 'gnus-topic-find-groups "gnus-topic")
(defcustom gnus-no-groups-message "No news is good news"
"Message displayed by Gnus when no groups are available."
:group 'gnus-start
:type 'string)
(defcustom gnus-keep-same-level nil
"Non-nil means that the newsgroup after this one will be on the same level.
When you type, for instance, \\`n' after reading the last article in the
current newsgroup, you will go to the next newsgroup. If this variable
is nil, the next newsgroup will be the next from the group
buffer.
If this variable is non-nil, Gnus will either put you in the
next newsgroup with the same level, or, if no such newsgroup is
available, the next newsgroup with the lowest possible level higher
than the current level.
If this variable is `best', Gnus will make the next newsgroup the one
with the best level."
:group 'gnus-group-levels
:type '(choice (const nil)
(const best)
(sexp :tag "other" t)))
(defcustom gnus-group-goto-unread t
"If non-nil, movement commands will go to the next unread and subscribed group."
:link '(custom-manual "(gnus)Group Maneuvering")
:group 'gnus-group-various
:type 'boolean)
(defcustom gnus-goto-next-group-when-activating t
"If non-nil, the \\<gnus-group-mode-map>\\[gnus-group-get-new-news-this-group] command will advance point to the next group."
:link '(custom-manual "(gnus)Scanning New Messages")
:group 'gnus-group-various
:type 'boolean)
(defcustom gnus-permanently-visible-groups nil
"Regexp to match groups that should always be listed in the group buffer.
This means that they will still be listed even when there are no
unread articles in the groups.
If nil, no groups are permanently visible."
:group 'gnus-group-listing
:type '(choice regexp (const nil)))
(defcustom gnus-safe-html-newsgroups "\\`nnrss[+:]"
"Groups in which links in html articles are considered all safe.
The value may be a regexp matching those groups, a list of group names,
or nil. This overrides `mm-w3m-safe-url-regexp' (which see). This is
effective only when emacs-w3m renders html articles, i.e., in the case
`mm-text-html-renderer' is set to `w3m'."
:version "23.2"
:group 'gnus-group-various
:type '(choice regexp
(repeat :tag "List of group names" (string :tag "Group"))
(const nil)))
(defcustom gnus-list-groups-with-ticked-articles t
"If non-nil, list groups that have only ticked articles.
If nil, only list groups that have unread articles."
:group 'gnus-group-listing
:type 'boolean)
(defcustom gnus-group-default-list-level gnus-level-subscribed
"Default listing level.
When `gnus-group-use-permanent-levels' is non-nil, this level is
used as the starting level until the user sets a different level,
and is ignored afterwards."
:group 'gnus-group-listing
:type '(choice (integer :tag "Level")
(function :tag "Function returning level")))
(defcustom gnus-group-list-inactive-groups t
"If non-nil, inactive groups will be listed."
:group 'gnus-group-listing
:group 'gnus-group-levels
:type 'boolean)
(defcustom gnus-group-sort-function 'gnus-group-sort-by-alphabet
"Function used for sorting the group buffer.
This function will be called with group info entries as the arguments
for the groups to be sorted. Pre-made functions include
`gnus-group-sort-by-alphabet', `gnus-group-sort-by-real-name',
`gnus-group-sort-by-unread', `gnus-group-sort-by-level',
`gnus-group-sort-by-score', `gnus-group-sort-by-method',
`gnus-group-sort-by-server', and `gnus-group-sort-by-rank'.
This variable can also be a list of sorting functions. In that case,
the most significant sort function should be the last function in the
list."
:group 'gnus-group-listing
:link '(custom-manual "(gnus)Sorting Groups")
:type '(repeat :value-to-internal (lambda (widget value)
(if (listp value) value (list value)))
:match (lambda (widget value)
(or (symbolp value)
(widget-editable-list-match widget value)))
(choice (function-item gnus-group-sort-by-alphabet)
(function-item gnus-group-sort-by-real-name)
(function-item gnus-group-sort-by-unread)
(function-item gnus-group-sort-by-level)
(function-item gnus-group-sort-by-score)
(function-item gnus-group-sort-by-method)
(function-item gnus-group-sort-by-server)
(function-item gnus-group-sort-by-rank)
(function :tag "other" nil))))
(defcustom gnus-group-line-format "%M\ %S\ %p\ %P\ %5y:%B%(%g%)\n"
"Format of group lines.
It works along the same lines as a normal formatting string,
with some simple extensions.
%M Only marked articles (character, \"*\" or \" \")
%S Whether the group is subscribed (character, \"U\", \"K\", \"Z\" or \" \")
%L Level of subscribedness (integer)
%N Number of unread articles (integer)
%I Number of dormant articles (integer)
%i Number of ticked and dormant (integer)
%T Number of ticked articles (integer)
%R Number of read articles (integer)
%U Number of unseen articles (integer)
%t Estimated total number of articles (integer)
%y Number of unread, unticked articles (integer)
%G Group name (string)
%g Qualified group name (string)
%c Short (collapsed) group name. See `gnus-group-uncollapsed-levels'.
%C Group comment (string)
%D Group description (string)
%s Select method (string)
%o Moderated group (char, \"m\")
%p Process mark (char)
%B Whether a summary buffer for the group is open (char, \"*\")
%O Moderated group (string, \"(m)\" or \"\")
%P Topic indentation (string)
%m Whether there is new(ish) mail in the group (char, \"%\")
%n Select from where (string)
%z A string that look like `<%s:%n>' if a foreign select method is used
%d The date the group was last entered.
%E Icon as defined by `gnus-group-icon-list'.
%F The disk space used by the articles fetched by both the cache and agent.
%u User defined specifier. The next character in the format string should
be a letter. Gnus will call the function gnus-user-format-function-X,
where X is the letter following %u. The function will be passed a
single dummy parameter as argument. The function should return a
string, which will be inserted into the buffer just like information
from any other group specifier.
Note that this format specification is not always respected. For
reasons of efficiency, when listing killed groups, this specification
is ignored altogether. If the spec is changed considerably, your
output may end up looking strange when listing both alive and killed
groups.
If you use %o or %O, reading the active file will be slower and quite
a bit of extra memory will be used. %D and %F will also worsen
performance. Also note that if you change the format specification to
include any of these specs, you must probably re-start Gnus to see
them go into effect.
General format specifiers can also be used.
See Info node `(gnus)Formatting Variables'."
:link '(custom-manual "(gnus)Formatting Variables")
:group 'gnus-group-visual
:type 'string)
(defcustom gnus-group-mode-line-format "Gnus: %%b {%M\ %:%S}"
"The format specification for the group mode line.
It works along the same lines as a normal formatting string,
with some simple extensions:
%S The native news server.
%M The native select method.
%: \":\" if %S isn't \"\"."
:group 'gnus-group-visual
:type 'string)
(defcustom gnus-group-menu-hook nil
"Hook run after the creation of the group mode menu."
:group 'gnus-group-various
:type 'hook)
(defcustom gnus-group-catchup-group-hook nil
"Hook run when catching up a group from the group buffer."
:group 'gnus-group-various
:link '(custom-manual "(gnus)Group Data")
:type 'hook)
(defcustom gnus-group-update-group-hook nil
"Hook called when updating group lines."
:group 'gnus-group-visual
:type 'hook)
(defcustom gnus-group-prepare-function 'gnus-group-prepare-flat
"A function that is called to generate the group buffer.
The function is called with three arguments: The first is a number;
all group with a level less or equal to that number should be listed,
if the second is non-nil, empty groups should also be displayed. If
the third is non-nil, it is a number. No groups with a level lower
than this number should be displayed.
The only current function implemented is `gnus-group-prepare-flat'."
:group 'gnus-group-listing
:type 'function)
(defcustom gnus-group-prepare-hook nil
"Hook called after the group buffer has been generated.
If you want to modify the group buffer, you can use this hook."
:group 'gnus-group-listing
:type 'hook)
(defcustom gnus-suspend-gnus-hook nil
"Hook called when suspending (not exiting) Gnus."
:group 'gnus-exit
:type 'hook)
(defcustom gnus-exit-gnus-hook nil
"Hook called when exiting Gnus."
:group 'gnus-exit
:type 'hook)
(defcustom gnus-after-exiting-gnus-hook nil
"Hook called after exiting Gnus."
:group 'gnus-exit
:type 'hook)
(defcustom gnus-group-update-hook nil
"Hook called when a group line is changed."
:group 'gnus-group-visual
:version "24.1"
:type 'hook)
(defcustom gnus-useful-groups
'(("(ding) mailing list mirrored at gmane.io"
"gmane.emacs.gnus.general"
(nntp "Gmane"
(nntp-address "news.gmane.io")))
("Gnus bug archive"
"gnus.gnus-bug"
(nntp "news.gnus.org"
(nntp-address "news.gnus.org")))
("Local Gnus help group"
"gnus-help"
(nndoc "gnus-help"
(nndoc-article-type mbox)
(eval `(nndoc-address
,(let ((file (nnheader-find-etc-directory
"gnus-tut.txt" t)))
(unless file
(error "Couldn't find doc group"))
file))))))
"Alist of useful group-server pairs."
:group 'gnus-group-listing
:type '(repeat (list (string :tag "Description")
(string :tag "Name")
(sexp :tag "Method"))))
(defcustom gnus-group-highlight
'(;; Mail.
((and mailp (= unread 0) (eq level 1)) .
gnus-group-mail-1-empty)
((and mailp (eq level 1)) .
gnus-group-mail-1)
((and mailp (= unread 0) (eq level 2)) .
gnus-group-mail-2-empty)
((and mailp (eq level 2)) .
gnus-group-mail-2)
((and mailp (= unread 0) (eq level 3)) .
gnus-group-mail-3-empty)
((and mailp (eq level 3)) .
gnus-group-mail-3)
((and mailp (= unread 0)) .
gnus-group-mail-low-empty)
((and mailp) .
gnus-group-mail-low)
;; News.
((and (= unread 0) (eq level 1)) .
gnus-group-news-1-empty)
((and (eq level 1)) .
gnus-group-news-1)
((and (= unread 0) (eq level 2)) .
gnus-group-news-2-empty)
((and (eq level 2)) .
gnus-group-news-2)
((and (= unread 0) (eq level 3)) .
gnus-group-news-3-empty)
((and (eq level 3)) .
gnus-group-news-3)
((and (= unread 0) (eq level 4)) .
gnus-group-news-4-empty)
((and (eq level 4)) .
gnus-group-news-4)
((and (= unread 0) (eq level 5)) .
gnus-group-news-5-empty)
((and (eq level 5)) .
gnus-group-news-5)
((and (= unread 0) (eq level 6)) .
gnus-group-news-6-empty)
((and (eq level 6)) .
gnus-group-news-6)
((and (= unread 0)) .
gnus-group-news-low-empty)
(t .
gnus-group-news-low))
"Controls the highlighting of group buffer lines.
Below is a list of `Form'/`Face' pairs. When deciding how a
particular group line should be displayed, each form is
evaluated. The content of the face field after the first true form is
used. You can change how those group lines are displayed by
editing the face field.
It is also possible to change and add form fields, but currently that
requires an understanding of Lisp expressions. Hopefully this will
change in a future release. For now, you can use the following
variables in the Lisp expression:
`group': The name of the group.
`unread': The number of unread articles in the group.
`method': The select method used.
`total': The total number of articles in the group.
`mailp': Whether it's a mail group or not.
`level': The level of the group.
`score': The score of the group.
`ticked': The number of ticked articles.
`group-age': Time in seconds since the group was last read
(see info node `(gnus)Group Timestamp')."
:group 'gnus-group-visual
:type '(repeat (cons (sexp :tag "Form") face))
:risky t)
(defcustom gnus-new-mail-mark ?%
"Mark used for groups with new mail."
:group 'gnus-group-visual
:type 'character)
(defgroup gnus-group-icons nil
"Add Icons to your group buffer."
:group 'gnus-group-visual)
(defcustom gnus-group-icon-list nil
"Controls the insertion of icons into group buffer lines.
Below is a list of `Form'/`File' pairs. When deciding how a
particular group line should be displayed, each form is evaluated.
The icon from the file field after the first true form is used. You
can change how those group lines are displayed by editing the file
field. The File will either be found in the `image-load-path'
or by specifying the absolute name of the file.
It is also possible to change and add form fields, but currently that
requires an understanding of Lisp expressions. Hopefully this will
change in a future release. For now, you can use the same
variables in the Lisp expression as in `gnus-group-highlight'."
:group 'gnus-group-icons
:type '(repeat (cons (sexp :tag "Form") file))
:risky t)
(defcustom gnus-group-name-charset-method-alist nil
"Alist of method and the charset for group names.
For example:
(((nntp \"news.com.cn\") . cn-gb-2312))"
:version "21.1"
:group 'gnus-charset
:type '(repeat (cons (sexp :tag "Method") (symbol :tag "Charset"))))
(defcustom gnus-group-name-charset-group-alist
(if (mm-coding-system-p 'utf-8)
'((".*" . utf-8))
nil)
"Alist of group regexp and the charset for group names.
For example:
((\"\\.com\\.cn:\" . cn-gb-2312))"
:group 'gnus-charset
:type '(repeat (cons (regexp :tag "Group") (symbol :tag "Charset"))))
(defcustom gnus-group-jump-to-group-prompt nil
"Default prompt for `gnus-group-jump-to-group'.
If non-nil, the value should be a string or an alist. If it is a string,
e.g. \"nnml:\", in which case `gnus-group-jump-to-group' offers \"Group:
nnml:\" in the minibuffer prompt.
If it is an alist, it must consist of \(NUMBER . PROMPT) pairs, for example:
\((1 . \"\") (2 . \"nnfolder+archive:\")). The element with number 0 is
used when no prefix argument is given to `gnus-group-jump-to-group'."
:version "22.1"
:group 'gnus-group-various
:type '(choice (string :tag "Prompt string")
(const :tag "Empty" nil)
(repeat (cons (integer :tag "Argument")
(string :tag "Prompt string")))))
(defcustom gnus-group-listing-limit 1000
"A limit of the number of groups when listing.
If the number of groups is larger than the limit, list them in a
simple manner."
:group 'gnus-group-listing
:type 'integer)
;;; Internal variables
(defvar gnus-group-is-exiting-p nil)
(defvar gnus-group-is-exiting-without-update-p nil)
(defvar gnus-group-sort-alist-function 'gnus-group-sort-flat
"Function for sorting the group buffer.")
(defvar gnus-group-sort-selected-function 'gnus-group-sort-selected-flat
"Function for sorting the selected groups in the group buffer.")
(defvar gnus-group-indentation-function nil)
(defvar gnus-goto-missing-group-function nil)
(defvar gnus-group-update-group-function nil)
(defvar gnus-group-goto-next-group-function nil
"Function to override finding the next group after listing groups.")
(defvar gnus-group-edit-buffer nil)
(defvar gnus-tmp-active)
(defvar gnus-tmp-colon)
(defvar gnus-tmp-comment)
(defvar gnus-tmp-group)
(defvar gnus-tmp-group-icon)
(defvar gnus-tmp-header)
(defvar gnus-tmp-level)
(defvar gnus-tmp-marked)
(defvar gnus-tmp-marked-mark)
(defvar gnus-tmp-method)
(defvar gnus-tmp-moderated)
(defvar gnus-tmp-moderated-string)
(defvar gnus-tmp-newsgroup-description)
(defvar gnus-tmp-news-method)
(defvar gnus-tmp-news-method-string)
(defvar gnus-tmp-news-server)
(defvar gnus-tmp-number-of-read)
(defvar gnus-tmp-number-of-unread)
(defvar gnus-tmp-number-total)
(defvar gnus-tmp-process-marked)
(defvar gnus-tmp-qualified-group)
(defvar gnus-tmp-subscribed)
(defvar gnus-tmp-summary-live)
(defvar gnus-tmp-user-defined)
(defvar gnus-inhibit-demon)
(defvar gnus-pick-mode)
(defvar gnus-tmp-marked-mark)
(defvar gnus-tmp-number-of-unread)
(defvar gnus-group-line-format-alist
'((?M gnus-tmp-marked-mark ?c)
(?S gnus-tmp-subscribed ?c)
(?L gnus-tmp-level ?d)
(?N (cond ((eq number t) "*" )
((numberp number)
(int-to-string
(+ number
(range-length (cdr (assq 'dormant gnus-tmp-marked)))
(range-length (cdr (assq 'tick gnus-tmp-marked))))))
(t number))
?s)
(?R gnus-tmp-number-of-read ?s)
(?U (if (gnus-active gnus-tmp-group)
(gnus-number-of-unseen-articles-in-group gnus-tmp-group)
"*")
?s)
(?t gnus-tmp-number-total ?d)
(?y gnus-tmp-number-of-unread ?s)
(?I (range-length (cdr (assq 'dormant gnus-tmp-marked))) ?d)
(?T (range-length (cdr (assq 'tick gnus-tmp-marked))) ?d)
(?i (+ (range-length (cdr (assq 'dormant gnus-tmp-marked)))
(range-length (cdr (assq 'tick gnus-tmp-marked))))
?d)
(?g gnus-tmp-group ?s)
(?G gnus-tmp-qualified-group ?s)
(?c (gnus-short-group-name gnus-tmp-group)
?s)
(?C gnus-tmp-comment ?s)
(?D gnus-tmp-newsgroup-description ?s)
(?o gnus-tmp-moderated ?c)
(?O gnus-tmp-moderated-string ?s)
(?p gnus-tmp-process-marked ?c)
(?s gnus-tmp-news-server ?s)
(?n gnus-tmp-news-method ?s)
(?P gnus-group-indentation ?s)
(?E gnus-tmp-group-icon ?s)
(?B gnus-tmp-summary-live ?c)
(?z gnus-tmp-news-method-string ?s)
(?m (gnus-group-new-mail gnus-tmp-group) ?c)
(?d (gnus-group-timestamp-string gnus-tmp-group) ?s)
(?u gnus-tmp-user-defined ?s)
(?F (gnus-total-fetched-for gnus-tmp-group) ?s)
))
(defvar gnus-group-mode-line-format-alist
'((?S gnus-tmp-news-server ?s)
(?M gnus-tmp-news-method ?s)
(?u gnus-tmp-user-defined ?s)
(?: gnus-tmp-colon ?s)))
(defvar gnus-topic-topology nil
"The complete topic hierarchy.")
(defvar gnus-topic-alist nil
"The complete topic-group alist.")
(defvar gnus-group-marked nil)
(defvar gnus-group-list-mode nil)
(defvar gnus-group-listed-groups nil)
(defvar gnus-group-list-option nil)
;;;
;;; Gnus group mode
;;;
(define-keymap :keymap gnus-group-mode-map
"SPC" #'gnus-group-read-group
"=" #'gnus-group-select-group
"RET" #'gnus-group-select-group
"M-RET" #'gnus-group-quick-select-group
"M-SPC" #'gnus-group-visible-select-group
"C-M-<return>" #'gnus-group-select-group-ephemerally
"j" #'gnus-group-jump-to-group
"n" #'gnus-group-next-unread-group
"p" #'gnus-group-prev-unread-group
"DEL" #'gnus-group-prev-unread-group
"<delete>" #'gnus-group-prev-unread-group
"N" #'gnus-group-next-group
"P" #'gnus-group-prev-group
"M-n" #'gnus-group-next-unread-group-same-level
"M-p" #'gnus-group-prev-unread-group-same-level
"," #'gnus-group-best-unread-group
"." #'gnus-group-first-unread-group
"u" #'gnus-group-toggle-subscription-at-point
"U" #'gnus-group-toggle-subscription
"c" #'gnus-group-catchup-current
"C" #'gnus-group-catchup-current-all
"M-c" #'gnus-group-clear-data
"l" #'gnus-group-list-groups
"L" #'gnus-group-list-all-groups
"m" #'gnus-group-mail
"i" #'gnus-group-news
"g" #'gnus-group-get-new-news
"M-g" #'gnus-group-get-new-news-this-group
"R" #'gnus-group-restart
"r" #'gnus-group-read-init-file
"B" #'gnus-group-browse-foreign-server
"b" #'gnus-group-check-bogus-groups
"F" #'gnus-group-find-new-groups
"C-c C-d" #'gnus-group-describe-group
"M-d" #'gnus-group-describe-all-groups
"C-c C-a" #'gnus-group-apropos
"C-c C-M-a" #'gnus-group-description-apropos
"a" #'gnus-group-post-news
"ESC k" #'gnus-group-edit-local-kill
"ESC K" #'gnus-group-edit-global-kill
"C-k" #'gnus-group-kill-group
"C-y" #'gnus-group-yank-group
"C-w" #'gnus-group-kill-region
"C-x C-t" #'gnus-group-transpose-groups
"C-c C-l" #'gnus-group-list-killed
"C-c C-x" #'gnus-group-expire-articles
"C-c C-M-x" #'gnus-group-expire-all-groups
"V" #'gnus-version
"s" #'gnus-group-save-newsrc
"z" #'gnus-group-suspend
"q" #'gnus-group-exit
"Q" #'gnus-group-quit
"?" #'gnus-group-describe-briefly
"C-c C-i" #'gnus-info-find-node
"M-e" #'gnus-group-edit-group-method
"^" #'gnus-group-enter-server-mode
"<mouse-2>" #'gnus-mouse-pick-group
"<follow-link>" 'mouse-face
"<" #'beginning-of-buffer
">" #'end-of-buffer
"C-c C-b" #'gnus-bug
"C-c C-s" #'gnus-group-sort-groups
"t" #'gnus-topic-mode
"C-c M-g" #'gnus-activate-all-groups
"M-&" #'gnus-group-universal-argument
"#" #'gnus-group-mark-group
"M-#" #'gnus-group-unmark-group
"~" (define-keymap :prefix 'gnus-group-cloud-map
"u" #'gnus-cloud-upload-all-data
"~" #'gnus-cloud-upload-all-data
"d" #'gnus-cloud-download-all-data
"RET" #'gnus-cloud-download-all-data)
"M" (define-keymap :prefix 'gnus-group-mark-map
"m" #'gnus-group-mark-group
"u" #'gnus-group-unmark-group
"w" #'gnus-group-mark-region
"b" #'gnus-group-mark-buffer
"r" #'gnus-group-mark-regexp
"U" #'gnus-group-unmark-all-groups)
"D" (define-keymap :prefix 'gnus-group-sieve-map
"u" #'gnus-sieve-update
"g" #'gnus-sieve-generate)
"G" (define-keymap :prefix 'gnus-group-group-map
"d" #'gnus-group-make-directory-group
"h" #'gnus-group-make-help-group
"u" #'gnus-group-make-useful-group
"l" #'gnus-group-nnimap-edit-acl
"m" #'gnus-group-make-group
"E" #'gnus-group-edit-group
"e" #'gnus-group-edit-group-method
"p" #'gnus-group-edit-group-parameters
"v" #'gnus-group-add-to-virtual
"V" #'gnus-group-make-empty-virtual
"D" #'gnus-group-enter-directory
"f" #'gnus-group-make-doc-group
"w" #'gnus-group-make-web-group
"G" #'gnus-group-read-ephemeral-search-group
"g" #'gnus-group-make-search-group
"M" #'gnus-group-read-ephemeral-group
"r" #'gnus-group-rename-group
"R" #'gnus-group-make-rss-group
"c" #'gnus-group-customize
"z" #'gnus-group-compact-group
"x" #'gnus-group-expunge-group
"DEL" #'gnus-group-delete-group
"<delete>" #'gnus-group-delete-group
"S" (define-keymap :prefix 'gnus-group-sort-map
"s" #'gnus-group-sort-groups
"a" #'gnus-group-sort-groups-by-alphabet
"u" #'gnus-group-sort-groups-by-unread
"l" #'gnus-group-sort-groups-by-level
"v" #'gnus-group-sort-groups-by-score
"r" #'gnus-group-sort-groups-by-rank
"m" #'gnus-group-sort-groups-by-method
"n" #'gnus-group-sort-groups-by-real-name)
"P" (define-keymap :prefix 'gnus-group-sort-selected-map
"s" #'gnus-group-sort-selected-groups
"a" #'gnus-group-sort-selected-groups-by-alphabet
"u" #'gnus-group-sort-selected-groups-by-unread
"l" #'gnus-group-sort-selected-groups-by-level
"v" #'gnus-group-sort-selected-groups-by-score
"r" #'gnus-group-sort-selected-groups-by-rank
"m" #'gnus-group-sort-selected-groups-by-method
"n" #'gnus-group-sort-selected-groups-by-real-name))
"A" (define-keymap :prefix 'gnus-group-list-map
"k" #'gnus-group-list-killed
"z" #'gnus-group-list-zombies
"s" #'gnus-group-list-groups
"u" #'gnus-group-list-all-groups
"A" #'gnus-group-list-active
"a" #'gnus-group-apropos
"d" #'gnus-group-description-apropos
"m" #'gnus-group-list-matching
"M" #'gnus-group-list-all-matching
"l" #'gnus-group-list-level
"c" #'gnus-group-list-cached
"?" #'gnus-group-list-dormant
"!" #'gnus-group-list-ticked
"/" (define-keymap :prefix 'gnus-group-list-limit-map
"k" #'gnus-group-list-limit
"z" #'gnus-group-list-limit
"s" #'gnus-group-list-limit
"u" #'gnus-group-list-limit
"A" #'gnus-group-list-limit
"m" #'gnus-group-list-limit
"M" #'gnus-group-list-limit
"l" #'gnus-group-list-limit
"c" #'gnus-group-list-limit
"?" #'gnus-group-list-limit
"!" #'gnus-group-list-limit)
"f" (define-keymap :prefix 'gnus-group-list-flush-map
"k" #'gnus-group-list-flush
"z" #'gnus-group-list-flush
"s" #'gnus-group-list-flush
"u" #'gnus-group-list-flush
"A" #'gnus-group-list-flush
"m" #'gnus-group-list-flush
"M" #'gnus-group-list-flush
"l" #'gnus-group-list-flush
"c" #'gnus-group-list-flush
"?" #'gnus-group-list-flush
"!" #'gnus-group-list-flush)
"p" (define-keymap :prefix 'gnus-group-list-plus-map
"k" #'gnus-group-list-plus
"z" #'gnus-group-list-plus
"s" #'gnus-group-list-plus
"u" #'gnus-group-list-plus
"A" #'gnus-group-list-plus
"m" #'gnus-group-list-plus
"M" #'gnus-group-list-plus
"l" #'gnus-group-list-plus
"c" #'gnus-group-list-plus
"?" #'gnus-group-list-plus
"!" #'gnus-group-list-plus))
"W" (define-keymap :prefix 'gnus-group-score-map
"f" #'gnus-score-flush-cache
"e" #'gnus-score-edit-all-score)
"H" (define-keymap :prefix 'gnus-group-help-map
"d" #'gnus-group-describe-group
"v" #'gnus-version)
"S" (define-keymap :prefix 'gnus-group-sub-map
"l" #'gnus-group-set-current-level
"t" #'gnus-group-toggle-subscription-at-point
"s" #'gnus-group-toggle-subscription
"k" #'gnus-group-kill-group
"y" #'gnus-group-yank-group
"w" #'gnus-group-kill-region
"C-k" #'gnus-group-kill-level
"z" #'gnus-group-kill-all-zombies))
(defun gnus-topic-mode-p ()
"Return non-nil in `gnus-topic-mode'."
(and (boundp 'gnus-topic-mode)
(symbol-value 'gnus-topic-mode)))
(defun gnus-group-make-menu-bar ()
(unless (boundp 'gnus-group-reading-menu)
(easy-menu-define
gnus-group-reading-menu gnus-group-mode-map ""
'("Group"
["Read" gnus-group-read-group
:included (not (gnus-topic-mode-p))
:active (gnus-group-group-name)]
["Read " gnus-topic-read-group
:included (gnus-topic-mode-p)]
["Select" gnus-group-select-group
:included (not (gnus-topic-mode-p))
:active (gnus-group-group-name)]
["Select " gnus-topic-select-group
:included (gnus-topic-mode-p)]
["See old articles" (gnus-group-select-group 'all)
:keys "C-u SPC" :active (gnus-group-group-name)]
["Catch up" gnus-group-catchup-current
:included (not (gnus-topic-mode-p))
:active (gnus-group-group-name)
:help "Mark unread articles in the current group as read"]
["Catch up " gnus-topic-catchup-articles
:included (gnus-topic-mode-p)
:help "Mark unread articles in the current group or topic as read"]
["Catch up all articles" gnus-group-catchup-current-all
(gnus-group-group-name)]
["Check for new articles" gnus-group-get-new-news-this-group
:included (not (gnus-topic-mode-p))
:active (gnus-group-group-name)
:help "Check for new messages in current group"]
["Check for new articles " gnus-topic-get-new-news-this-topic
:included (gnus-topic-mode-p)
:help "Check for new messages in current group or topic"]
["Toggle subscription" gnus-group-toggle-subscription-at-point
(gnus-group-group-name)]
["Kill" gnus-group-kill-group :active (gnus-group-group-name)
:help "Kill (remove) current group"]
["Yank" gnus-group-yank-group gnus-list-of-killed-groups]
["Describe" gnus-group-describe-group :active (gnus-group-group-name)
:help "Display description of the current group"]
;; Actually one should check, if any of the marked groups gives t for
;; (gnus-check-backend-function 'request-expire-articles ...)
["Expire articles" gnus-group-expire-articles
:included (not (gnus-topic-mode-p))
:active (or (and (gnus-group-group-name)
(gnus-check-backend-function
'request-expire-articles
(gnus-group-group-name))) gnus-group-marked)]
["Expire articles " gnus-topic-expire-articles
:included (gnus-topic-mode-p)]
["Set group level..." gnus-group-set-current-level
(gnus-group-group-name)]
["Select quick" gnus-group-quick-select-group (gnus-group-group-name)]
["Customize" gnus-group-customize (gnus-group-group-name)]
["Compact" gnus-group-compact-group
:active (gnus-group-group-name)]
("Edit"
["Parameters" gnus-group-edit-group-parameters
:included (not (gnus-topic-mode-p))
:active (gnus-group-group-name)]
["Parameters " gnus-topic-edit-parameters
:included (gnus-topic-mode-p)]
["Select method" gnus-group-edit-group-method
(gnus-group-group-name)]
["Info" gnus-group-edit-group (gnus-group-group-name)]
["Local kill file" gnus-group-edit-local-kill (gnus-group-group-name)]
["Global kill file" gnus-group-edit-global-kill t])))
(easy-menu-define
gnus-group-group-menu gnus-group-mode-map ""
'("Groups"
("Listing"
["List unread subscribed groups" gnus-group-list-groups t]
["List (un)subscribed groups" gnus-group-list-all-groups t]
["List killed groups" gnus-group-list-killed gnus-killed-list]
["List zombie groups" gnus-group-list-zombies gnus-zombie-list]
["List level..." gnus-group-list-level t]
["Describe all groups" gnus-group-describe-all-groups t]
["Group apropos..." gnus-group-apropos t]
["Group and description apropos..." gnus-group-description-apropos t]
["List groups matching..." gnus-group-list-matching t]
["List all groups matching..." gnus-group-list-all-matching t]
["List active file" gnus-group-list-active t]
["List groups with cached" gnus-group-list-cached t]
["List groups with dormant" gnus-group-list-dormant t]
["List groups with ticked" gnus-group-list-ticked t])
("Sort"
["Default sort" gnus-group-sort-groups t]
["Sort by method" gnus-group-sort-groups-by-method t]
["Sort by rank" gnus-group-sort-groups-by-rank t]
["Sort by score" gnus-group-sort-groups-by-score t]
["Sort by level" gnus-group-sort-groups-by-level t]
["Sort by unread" gnus-group-sort-groups-by-unread t]
["Sort by name" gnus-group-sort-groups-by-alphabet t]
["Sort by real name" gnus-group-sort-groups-by-real-name t])
("Sort process/prefixed"
["Default sort" gnus-group-sort-selected-groups
(not (gnus-topic-mode-p))]
["Sort by method" gnus-group-sort-selected-groups-by-method
(not (gnus-topic-mode-p))]
["Sort by rank" gnus-group-sort-selected-groups-by-rank
(not (gnus-topic-mode-p))]
["Sort by score" gnus-group-sort-selected-groups-by-score
(not (gnus-topic-mode-p))]
["Sort by level" gnus-group-sort-selected-groups-by-level
(not (gnus-topic-mode-p))]
["Sort by unread" gnus-group-sort-selected-groups-by-unread
(not (gnus-topic-mode-p))]
["Sort by name" gnus-group-sort-selected-groups-by-alphabet
(not (gnus-topic-mode-p))]
["Sort by real name" gnus-group-sort-selected-groups-by-real-name
(not (gnus-topic-mode-p))])
("Mark"
["Toggle/Set mark" gnus-group-mark-group
(and (gnus-group-group-name)
(not (memq (gnus-group-group-name) gnus-group-marked)))]
["Remove mark" gnus-group-unmark-group
(and (gnus-group-group-name)
(memq (gnus-group-group-name) gnus-group-marked))]
["Remove all marks" gnus-group-unmark-all-groups gnus-group-marked]
["Mark by regexp..." gnus-group-mark-regexp t]
["Mark region" gnus-group-mark-region :active mark-active]
["Mark buffer" gnus-group-mark-buffer t]
["Execute command" gnus-group-universal-argument
(or gnus-group-marked (gnus-group-group-name))])
("Subscribe"
["Toggle subscription..." gnus-group-toggle-subscription t]
["Kill all newsgroups in region" gnus-group-kill-region
:active mark-active]
["Kill all zombie groups" gnus-group-kill-all-zombies
gnus-zombie-list]
["Kill all groups on level..." gnus-group-kill-level t])
("Foreign groups"
["Make a foreign group..." gnus-group-make-group t]
["Add a directory group..." gnus-group-make-directory-group t]
["Add the help group" gnus-group-make-help-group t]
["Make a doc group..." gnus-group-make-doc-group t]
["Make a web group..." gnus-group-make-web-group t]
["Read a search group..." gnus-group-read-ephemeral-search-group t]
["Make a search group..." gnus-group-make-search-group t]
["Make a virtual group..." gnus-group-make-empty-virtual t]
["Add a group to a virtual..." gnus-group-add-to-virtual t]
["Make an ephemeral group..." gnus-group-read-ephemeral-group t]
["Make an RSS group..." gnus-group-make-rss-group t]
["Rename group..." gnus-group-rename-group
(gnus-check-backend-function
'request-rename-group (gnus-group-group-name))]
["Delete group" gnus-group-delete-group
(gnus-check-backend-function
'request-delete-group (gnus-group-group-name))])
("Move"
["Next" gnus-group-next-group t]
["Previous" gnus-group-prev-group t]
["Next unread" gnus-group-next-unread-group t]
["Previous unread" gnus-group-prev-unread-group t]
["Next unread same level" gnus-group-next-unread-group-same-level t]
["Previous unread same level"
gnus-group-prev-unread-group-same-level t]
["Jump to group..." gnus-group-jump-to-group t]
["First unread group" gnus-group-first-unread-group t]
["Best unread group" gnus-group-best-unread-group t])
("Sieve"
["Generate" gnus-sieve-generate t]
["Generate and update" gnus-sieve-update t])
["Delete bogus groups" gnus-group-check-bogus-groups t]
["Find new newsgroups" gnus-group-find-new-groups t]
["Transpose" gnus-group-transpose-groups
(gnus-group-group-name)]
["Read a directory as a group..." gnus-group-enter-directory t]))
(easy-menu-define
gnus-group-misc-menu gnus-group-mode-map ""
'("Gnus"
["Send a mail" gnus-group-mail t]
["Send a message (mail or news)" gnus-group-post-news t]
["Create a local message" gnus-group-news t]
["Check for new news" gnus-group-get-new-news
:help "Get newly arrived articles"]
["Send queued messages" gnus-delay-send-queue
:help "Send all messages that are scheduled to be sent now"]
["Activate all groups" gnus-activate-all-groups t]
["Restart Gnus" gnus-group-restart t]
["Read init file" gnus-group-read-init-file t]
["Browse foreign server..." gnus-group-browse-foreign-server t]
["Enter server buffer" gnus-group-enter-server-mode t]
["Expire all expirable articles" gnus-group-expire-all-groups t]
["Gnus version" gnus-version t]
["Save .newsrc files" gnus-group-save-newsrc t]
["Suspend Gnus" gnus-group-suspend t]
["Clear dribble buffer" gnus-group-clear-dribble t]
["Read manual" gnus-info-find-node t]
["Flush score cache" gnus-score-flush-cache t]
["Toggle topics" gnus-topic-mode t]
["Send a bug report" gnus-bug t]
["Exit from Gnus" gnus-group-exit :help "Quit reading news"]
["Exit without saving" gnus-group-quit t]))
(gnus-run-hooks 'gnus-group-menu-hook)))
(defvar gnus-group-tool-bar-map nil)
(defcustom gnus-group-tool-bar
'((gnus-group-post-news "mail/compose")
;; Some useful agent icons? I don't use the agent so agent users should
;; suggest useful commands:
(gnus-agent-toggle-plugged
"unplugged" t
:help "Gnus is currently unplugged. Click to work online."
:visible (and gnus-agent (not gnus-plugged)))
(gnus-agent-toggle-plugged
"plugged" t
:help "Gnus is currently plugged. Click to work offline."
:visible (and gnus-agent gnus-plugged))
(gnus-group-send-queue
"mail/outbox" t
:visible (and gnus-agent gnus-plugged)