1 ;;; gnus-cus.el --- customization commands for Gnus
3 ;; Copyright (C) 1996, 1999, 2000, 2001, 2002, 2003
4 ;; Free Software Foundation, Inc.
6 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
39 (defun gnus-custom-mode ()
40 "Major mode for editing Gnus customization buffers.
42 The following commands are available:
44 \\[widget-forward] Move to next button or editable field.
45 \\[widget-backward] Move to previous button or editable field.
46 \\[widget-button-click] Activate button under the mouse pointer.
47 \\[widget-button-press] Activate button under point.
49 Entry to this mode calls the value of `gnus-custom-mode-hook'
50 if that value is non-nil."
51 (kill-all-local-variables)
52 (setq major-mode 'gnus-custom-mode
53 mode-name "Gnus Customize")
54 (use-local-map widget-keymap)
56 (when (and (facep 'custom-button-face)
57 (facep 'custom-button-pressed-face))
58 (set (make-local-variable 'widget-button-face)
60 (set (make-local-variable 'widget-button-pressed-face)
61 'custom-button-pressed-face)
62 (set (make-local-variable 'widget-mouse-face)
63 'custom-button-pressed-face))
64 (when (and (boundp 'custom-raised-buttons)
65 (symbol-value 'custom-raised-buttons))
66 (set (make-local-variable 'widget-push-button-prefix) "")
67 (set (make-local-variable 'widget-push-button-suffix) "")
68 (set (make-local-variable 'widget-link-prefix) "")
69 (set (make-local-variable 'widget-link-suffix) ""))
70 (gnus-run-hooks 'gnus-custom-mode-hook))
72 ;;; Group Customization:
74 (defconst gnus-group-parameters
75 '((extra-aliases (choice
81 (gnus-email-address :tag "Address")))
82 (gnus-email-address :tag "Address")) "\
83 Store messages posted from or to this address in this group.
85 You must be using gnus-group-split for this to work. The VALUE of the
86 nnmail-split-fancy SPLIT generated for this group will match these
89 (split-regexp (regexp :tag "gnus-group-split Regular Expression") "\
90 Like gnus-group-split Address, but expects a regular expression.")
92 (split-exclude (list :tag "gnus-group-split Restricts"
94 :inline t (regexp :tag "Restrict"))) "\
95 Regular expression that cancels gnus-group-split matches.
97 Each entry is added to the nnmail-split-fancy SPLIT as a separate
100 (split-spec (choice :tag "gnus-group-split Overrider"
101 (sexp :tag "Fancy Split")
102 (const :tag "Catch All" catch-all)
103 (const :tag "Ignore" nil)) "\
104 Override all other gnus-group-split fields.
106 In `Fancy Split', you can enter any nnmail-split-fancy SPLIT. Note
107 that the name of this group won't be automatically assumed, you have
108 to add it to the SPLITs yourself. This means you can use such splits
109 to split messages to other groups too.
111 If you select `Catch All', this group will get postings for any
112 messages not matched in any other group. It overrides the variable
113 gnus-group-split-default-catch-all-group.
115 Selecting `Ignore' forces no SPLIT to be generated for this group,
116 disabling all other gnus-group-split fields.")
118 (broken-reply-to (const :tag "Broken Reply To" t) "\
119 Ignore `Reply-To' headers in this group.
121 That can be useful if you're reading a mailing list group where the
122 listserv has inserted `Reply-To' headers that point back to the
123 listserv itself. This is broken behavior. So there!")
125 (to-group (string :tag "To Group") "\
126 All posts will be sent to the specified group.")
128 (gcc-self (choice :tag "GCC"
130 (const :tag "To current group" t)
132 (string :format "%v" :hide-front-space t)) "\
133 Specify default value for GCC header.
135 If this symbol is present in the group parameter list and set to t,
136 new composed messages will be `Gcc''d to the current group. If it is
137 present and set to `none', no `Gcc:' header will be generated, if it
138 is present and a string, this string will be inserted literally as a
139 `gcc' header (this symbol takes precedence over any default `Gcc'
140 rules as described later).")
142 (expiry-wait (choice :tag "Expire Wait"
146 (number :hide-front-space t
150 Overrides any `nnmail-expiry-wait' and `nnmail-expiry-wait-function'
151 when expiring expirable messages. The value can either be a number of
152 days (not necessarily an integer) or the symbols `never' or
155 (expiry-target (choice :tag "Expiry Target"
158 (function :format "%v" nnmail-)
160 Where expired messages end up.
162 Overrides `nnmail-expiry-target', which see.")
164 (score-file (file :tag "Score File") "\
165 Make the specified file into the current score file.
166 This means that all score commands you issue will end up in this file.")
168 (adapt-file (file :tag "Adapt File") "\
169 Make the specified file into the current adaptive file.
170 All adaptive score entries will be put into this file.")
172 (admin-address (gnus-email-address :tag "Admin Address") "\
173 Administration address for a mailing list.
175 When unsubscribing to a mailing list you should never send the
176 unsubscription notice to the mailing list itself. Instead, you'd
177 send messages to the administrative address. This parameter allows
178 you to put the admin address somewhere convenient.")
180 (display (choice :tag "Display"
185 (sexp :tag "Other")) "\
186 Which articles to display on entering the group.
189 Display all articles, both read and unread.
192 Display the last NUMBER articles in the group. This is the same as
193 entering the group with C-u NUMBER.
196 Display the default visible articles, which normally includes
197 unread and ticked articles.
200 Display the articles that satisfy the S-expression. The S-expression
201 should be in an array form.")
203 (comment (string :tag "Comment") "\
204 An arbitrary comment on the group.")
206 (visible (const :tag "Permanently visible" t) "\
207 Always display this group, even when there are no unread articles
211 (choice :tag "Highlight words"
213 (repeat (list (regexp :tag "Highlight regexp")
214 (number :tag "Group for entire word" 0)
215 (number :tag "Group for displayed part" 0)
217 gnus-emphasis-highlight-words))))
219 See `gnus-emphasis-alist'.")
222 (choice :tag "Posting style"
228 (const signature-file)
233 (string :format "%v"))))
235 See `gnus-posting-styles'."))
236 "Alist of valid group or topic parameters.
238 Each entry has the form (NAME TYPE DOC), where NAME is the parameter
239 itself (a symbol), TYPE is the parameters type (a sexp widget), and
240 DOC is a documentation string for the parameter.")
242 (defconst gnus-extra-topic-parameters
243 '((subscribe (regexp :tag "Subscribe") "\
244 If `gnus-subscribe-newsgroup-method' or
245 `gnus-subscribe-options-newsgroup-method' is set to
246 `gnus-subscribe-topics', new groups that matches this regexp will
247 automatically be subscribed to this topic")
248 (subscribe-level (integer :tag "Subscribe Level" :value 1) "\
249 If this topic parameter is set, when new groups are subscribed
250 automatically under this topic (via the `subscribe' topic parameter)
251 assign this level to the group, rather than the default level
252 set in `gnus-level-default-subscribed'"))
253 "Alist of topic parameters that are not also group parameters.
255 Each entry has the form (NAME TYPE DOC), where NAME is the parameter
256 itself (a symbol), TYPE is the parameters type (a sexp widget), and
257 DOC is a documentation string for the parameter.")
259 (defconst gnus-extra-group-parameters
260 '((uidvalidity (string :tag "IMAP uidvalidity") "\
261 Server-assigned value attached to IMAP groups, used to maintain consistency."))
262 "Alist of group parameters that are not also topic parameters.
264 Each entry has the form (NAME TYPE DOC), where NAME is the parameter
265 itself (a symbol), TYPE is the parameters type (a sexp widget), and
266 DOC is a documentation string for the parameter.")
269 (defconst gnus-agent-parameters
271 (sexp :tag "Selection Predicate" :value false)
272 "Predicate used to automatically select articles for downloading."
273 gnus-agent-cat-predicate)
275 (choice :tag "Score File" :value nil
276 (const file :tag "Use group's score files")
277 (repeat (list (string :format "%v" :tag "File name"))))
278 "Which score files to use when using score to select articles to fetch.
281 All articles will be scored to zero (0).
284 The group's score files will be used to score the articles.
287 A list of score file names."
288 gnus-agent-cat-score-file)
290 (integer :tag "Max Length of Short Article" :value "")
291 "The SHORT predicate will evaluate to true when the article is
292 shorter than this length." gnus-agent-cat-length-when-short)
294 (integer :tag "Min Length of Long Article" :value "")
295 "The LONG predicate will evaluate to true when the article is
296 longer than this length." gnus-agent-cat-length-when-long)
298 (integer :tag "Low Score Limit" :value "")
299 "The LOW predicate will evaluate to true when the article scores
300 lower than this limit." gnus-agent-cat-low-score)
302 (integer :tag "High Score Limit" :value "")
303 "The HIGH predicate will evaluate to true when the article scores
304 higher than this limit." gnus-agent-cat-high-score)
305 (agent-days-until-old
306 (integer :tag "Days Until Old" :value "")
307 "The OLD predicate will evaluate to true when the fetched article
308 has been stored locally for at least this many days."
309 gnus-agent-cat-days-until-old)
310 (agent-enable-expiration
311 (radio :tag "Expire in this Group or Topic" :value nil
312 ; (const :format "Inherit " nil)
313 (const :format "Enable " ENABLE)