1 ;;; gnus-cus.el --- customization commands for Gnus
3 ;; Copyright (C) 1996,1999, 2000 Free Software Foundation, Inc.
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
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 2, or (at your option)
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; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
37 ;; There should be special validation for this.
38 (define-widget 'gnus-email-address 'string
41 (defun gnus-custom-mode ()
42 "Major mode for editing Gnus customization buffers.
44 The following commands are available:
46 \\[widget-forward] Move to next button or editable field.
47 \\[widget-backward] Move to previous button or editable field.
48 \\[widget-button-click] Activate button under the mouse pointer.
49 \\[widget-button-press] Activate button under point.
51 Entry to this mode calls the value of `gnus-custom-mode-hook'
52 if that value is non-nil."
53 (kill-all-local-variables)
54 (setq major-mode 'gnus-custom-mode
55 mode-name "Gnus Customize")
56 (use-local-map widget-keymap)
58 (when (and (facep 'custom-button-face)
59 (facep 'custom-button-pressed-face))
60 (set (make-local-variable 'widget-button-face)
62 (set (make-local-variable 'widget-button-pressed-face)
63 'custom-button-pressed-face)
64 (set (make-local-variable 'widget-mouse-face)
65 'custom-button-pressed-face))
66 (when (and (boundp 'custom-raised-buttons)
67 (symbol-value 'custom-raised-buttons))
68 (set (make-local-variable 'widget-push-button-prefix) "")
69 (set (make-local-variable 'widget-push-button-suffix) "")
70 (set (make-local-variable 'widget-link-prefix) "")
71 (set (make-local-variable 'widget-link-suffix) ""))
72 (gnus-run-hooks 'gnus-custom-mode-hook))
74 ;;; Group Customization:
76 (defconst gnus-group-parameters
77 '((to-address (gnus-email-address :tag "To Address") "\
78 This will be used when doing followups and posts.
80 This is primarily useful in mail groups that represent closed
81 mailing lists--mailing lists where it's expected that everybody that
82 writes to the mailing list is subscribed to it. Since using this
83 parameter ensures that the mail only goes to the mailing list itself,
84 it means that members won't receive two copies of your followups.
86 Using `to-address' will actually work whether the group is foreign or
87 not. Let's say there's a group on the server that is called
88 `fa.4ad-l'. This is a real newsgroup, but the server has gotten the
89 articles from a mail-to-news gateway. Posting directly to this group
90 is therefore impossible--you have to send mail to the mailing list
93 The gnus-group-split mail splitting mechanism will behave as if this
94 address was listed in gnus-group-split Addresses (see below).")
96 (to-list (gnus-email-address :tag "To List") "\
97 This address will be used when doing a `a' in the group.
99 It is totally ignored when doing a followup--except that if it is
100 present in a news group, you'll get mail group semantics when doing
103 The gnus-group-split mail splitting mechanism will behave as if this
104 address was listed in gnus-group-split Addresses (see below).")
106 (extra-aliases (choice
112 (gnus-email-address :tag "Address")))
113 (gnus-email-address :tag "Address")) "\
114 Store messages posted from or to this address in this group.
116 You must be using gnus-group-split for this to work. The VALUE of the
117 nnmail-split-fancy SPLIT generated for this group will match these
120 (split-regexp (regexp :tag "gnus-group-split Regular Expression") "\
121 Like gnus-group-split Address, but expects a regular expression.")
123 (split-exclude (list :tag "gnus-group-split Restricts"
125 :inline t (regexp :tag "Restrict"))) "\
126 Regular expression that cancels gnus-group-split matches.
128 Each entry is added to the nnmail-split-fancy SPLIT as a separate
131 (split-spec (choice :tag "gnus-group-split Overrider"
132 (sexp :tag "Fancy Split")
133 (const :tag "Catch All" catch-all)
134 (const :tag "Ignore" nil)) "\
135 Override all other gnus-group-split fields.
137 In `Fancy Split', you can enter any nnmail-split-fancy SPLIT. Note
138 that the name of this group won't be automatically assumed, you have
139 to add it to the SPLITs yourself. This means you can use such splits
140 to split messages to other groups too.
142 If you select `Catch All', this group will get postings for any
143 messages not matched in any other group. It overrides the variable
144 gnus-group-split-default-catch-all-group.
146 Selecting `Ignore' forces no SPLIT to be generated for this group,
147 disabling all other gnus-group-split fields.")
149 (broken-reply-to (const :tag "Broken Reply To" t) "\
150 Ignore `Reply-To' headers in this group.
152 That can be useful if you're reading a mailing list group where the
153 listserv has inserted `Reply-To' headers that point back to the
154 listserv itself. This is broken behavior. So there!")
156 (to-group (string :tag "To Group") "\
157 All posts will be sent to the specified group.")
159 (gcc-self (choice :tag "GCC"
161 (const :tag "To current group" t)
163 (string :format "%v" :hide-front-space t)) "\
164 Specify default value for GCC header.
166 If this symbol is present in the group parameter list and set to `t',
167 new composed messages will be `Gcc''d to the current group. If it is
168 present and set to `none', no `Gcc:' header will be generated, if it
169 is present and a string, this string will be inserted literally as a
170 `gcc' header (this symbol takes precedence over any default `Gcc'
171 rules as described later).")
173 (expiry-wait (choice :tag "Expire Wait"
177 (number :hide-front-space t
181 Overrides any `nnmail-expiry-wait' and `nnmail-expiry-wait-function'
182 when expiring expirable messages. The value can either be a number of
183 days (not necessarily an integer) or the symbols `never' or
186 (expiry-target (choice :tag "Expiry Target"
189 (function :format "%v" nnmail-)
191 Where expired messages end up.
193 Overrides `nnmail-expiry-target', which see.")
195 (score-file (file :tag "Score File") "\
196 Make the specified file into the current score file.
197 This means that all score commands you issue will end up in this file.")
199 (adapt-file (file :tag "Adapt File") "\
200 Make the specified file into the current adaptive file.
201 All adaptive score entries will be put into this file.")
203 (admin-address (gnus-email-address :tag "Admin Address") "\
204 Administration address for a mailing list.
206 When unsubscribing to a mailing list you should never send the
207 unsubscription notice to the mailing list itself. Instead, you'd
208 send messages to the administrative address. This parameter allows
209 you to put the admin address somewhere convenient.")
211 (display (choice :tag "Display"
215 Which articles to display on entering the group.
218 Display all articles, both read and unread.
221 Display the default visible articles, which normally includes
222 unread and ticked articles.")
224 (comment (string :tag "Comment") "\
225 An arbitrary comment on the group.")
227 (visible (const :tag "Permanently visible" t) "\
228 Always display this group, even when there are no unread articles
231 (charset (symbol :tag "Charset") "\
232 The default charset to use in the group.")
235 (choice :tag "Ignored charsets"
237 (repeat (symbol))) "\
238 List of charsets that should be ignored.
240 When these charsets are used in the \"charset\" parameter, the
241 default charset will be used instead.")
244 (choice :tag "Highlight words"
246 (repeat (list (regexp :tag "Highlight regexp")
247 (number :tag "Group for entire word" 0)
248 (number :tag "Group for displayed part" 0)
250 gnus-emphasis-highlight-words))))
252 See gnus-emphasis-alist.")
255 (choice :tag "Posting style"
261 (const signature-file)