1 ;;; gnus-group.el --- group mode commands for Gnus
3 ;; Copyright (C) 1996-2015 Free Software Foundation, Inc.
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software: you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation, either version 3 of the License, or
13 ;; (at your option) any later version.
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
29 (defvar tool-bar-mode)
45 (let ((features (cons 'gnus-group features)))
47 (unless (boundp 'gnus-cache-active-hashtb)
48 (defvar gnus-cache-active-hashtb nil)))
50 (autoload 'gnus-agent-total-fetched-for "gnus-agent")
51 (autoload 'gnus-cache-total-fetched-for "gnus-cache")
53 (autoload 'gnus-group-make-nnir-group "nnir")
55 (defcustom gnus-no-groups-message "No news is good news"
56 "*Message displayed by Gnus when no groups are available."
60 (defcustom gnus-keep-same-level nil
61 "*Non-nil means that the next newsgroup after the current will be on the same level.
62 When you type, for instance, `n' after reading the last article in the
63 current newsgroup, you will go to the next newsgroup. If this variable
64 is nil, the next newsgroup will be the next from the group
66 If this variable is non-nil, Gnus will either put you in the
67 next newsgroup with the same level, or, if no such newsgroup is
68 available, the next newsgroup with the lowest possible level higher
69 than the current level.
70 If this variable is `best', Gnus will make the next newsgroup the one
72 :group 'gnus-group-levels
73 :type '(choice (const nil)
75 (sexp :tag "other" t)))
77 (defcustom gnus-group-goto-unread t
78 "*If non-nil, movement commands will go to the next unread and subscribed group."
79 :link '(custom-manual "(gnus)Group Maneuvering")
80 :group 'gnus-group-various
83 (defcustom gnus-goto-next-group-when-activating t
84 "*If non-nil, the \\<gnus-group-mode-map>\\[gnus-group-get-new-news-this-group] command will advance point to the next group."
85 :link '(custom-manual "(gnus)Scanning New Messages")
86 :group 'gnus-group-various
89 (defcustom gnus-permanently-visible-groups nil
90 "*Regexp to match groups that should always be listed in the group buffer.
91 This means that they will still be listed even when there are no
92 unread articles in the groups.
94 If nil, no groups are permanently visible."
95 :group 'gnus-group-listing
96 :type '(choice regexp (const nil)))
98 (defcustom gnus-safe-html-newsgroups "\\`nnrss[+:]"
99 "Groups in which links in html articles are considered all safe.
100 The value may be a regexp matching those groups, a list of group names,
101 or nil. This overrides `mm-w3m-safe-url-regexp' (which see). This is
102 effective only when emacs-w3m renders html articles, i.e., in the case
103 `mm-text-html-renderer' is set to `w3m'."
105 :group 'gnus-group-various
106 :type '(choice regexp
107 (repeat :tag "List of group names" (string :tag "Group"))
110 (defcustom gnus-list-groups-with-ticked-articles t
111 "*If non-nil, list groups that have only ticked articles.
112 If nil, only list groups that have unread articles."
113 :group 'gnus-group-listing
116 (defcustom gnus-group-default-list-level gnus-level-subscribed
117 "Default listing level.
118 Ignored if `gnus-group-use-permanent-levels' is non-nil."
119 :group 'gnus-group-listing
120 :type '(choice (integer :tag "Level")
121 (function :tag "Function returning level")))
123 (defcustom gnus-group-list-inactive-groups t
124 "*If non-nil, inactive groups will be listed."
125 :group 'gnus-group-listing
126 :group 'gnus-group-levels
129 (defcustom gnus-group-sort-function 'gnus-group-sort-by-alphabet
130 "*Function used for sorting the group buffer.
131 This function will be called with group info entries as the arguments
132 for the groups to be sorted. Pre-made functions include
133 `gnus-group-sort-by-alphabet', `gnus-group-sort-by-real-name',
134 `gnus-group-sort-by-unread', `gnus-group-sort-by-level',
135 `gnus-group-sort-by-score', `gnus-group-sort-by-method',
136 `gnus-group-sort-by-server', and `gnus-group-sort-by-rank'.
138 This variable can also be a list of sorting functions. In that case,
139 the most significant sort function should be the last function in the
141 :group 'gnus-group-listing
142 :link '(custom-manual "(gnus)Sorting Groups")
143 :type '(repeat :value-to-internal (lambda (widget value)
144 (if (listp value) value (list value)))
145 :match (lambda (widget value)
147 (widget-editable-list-match widget value)))
148 (choice (function-item gnus-group-sort-by-alphabet)
149 (function-item gnus-group-sort-by-real-name)
150 (function-item gnus-group-sort-by-unread)
151 (function-item gnus-group-sort-by-level)
152 (function-item gnus-group-sort-by-score)
153 (function-item gnus-group-sort-by-method)
154 (function-item gnus-group-sort-by-server)
155 (function-item gnus-group-sort-by-rank)
156 (function :tag "other" nil))))
158 (defcustom gnus-group-line-format "%M\%S\%p\%P\%5y:%B%(%g%)\n"
159 "*Format of group lines.
160 It works along the same lines as a normal formatting string,
161 with some simple extensions.
163 %M Only marked articles (character, \"*\" or \" \")
164 %S Whether the group is subscribed (character, \"U\", \"K\", \"Z\" or \" \")
165 %L Level of subscribedness (integer)
166 %N Number of unread articles (integer)
167 %I Number of dormant articles (integer)
168 %i Number of ticked and dormant (integer)
169 %T Number of ticked articles (integer)
170 %R Number of read articles (integer)
171 %U Number of unseen articles (integer)
172 %t Estimated total number of articles (integer)
173 %y Number of unread, unticked articles (integer)
174 %G Group name (string)
175 %g Qualified group name (string)
176 %c Short (collapsed) group name. See `gnus-group-uncollapsed-levels'.
177 %C Group comment (string)
178 %D Group description (string)
179 %s Select method (string)
180 %o Moderated group (char, \"m\")
181 %p Process mark (char)
182 %B Whether a summary buffer for the group is open (char, \"*\")
183 %O Moderated group (string, \"(m)\" or \"\")
184 %P Topic indentation (string)
185 %m Whether there is new(ish) mail in the group (char, \"%\")
186 %n Select from where (string)
187 %z A string that look like `<%s:%n>' if a foreign select method is used
188 %d The date the group was last entered.
189 %E Icon as defined by `gnus-group-icon-list'.
190 %F The disk space used by the articles fetched by both the cache and agent.
191 %u User defined specifier. The next character in the format string should
192 be a letter. Gnus will call the function gnus-user-format-function-X,
193 where X is the letter following %u. The function will be passed a
194 single dummy parameter as argument. The function should return a
195 string, which will be inserted into the buffer just like information
196 from any other group specifier.
198 Note that this format specification is not always respected. For
199 reasons of efficiency, when listing killed groups, this specification
200 is ignored altogether. If the spec is changed considerably, your
201 output may end up looking strange when listing both alive and killed