Don't try to update buffers that have died in the meantime.
[gnus] / lisp / gnus-cus.el
1 ;;; gnus-cus.el --- customization commands for Gnus
2
3 ;; Copyright (C) 1996, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;;   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
5
6 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
7 ;; Keywords: news
8
9 ;; This file is part of GNU Emacs.
10
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 3 of the License, or
14 ;; (at your option) any later version.
15
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.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
23
24 ;;; Commentary:
25
26 ;;; Code:
27
28 (require 'wid-edit)
29 (require 'gnus)
30 (require 'gnus-agent)
31 (require 'gnus-score)
32 (require 'gnus-topic)
33 (require 'gnus-art)
34
35 ;;; Widgets:
36
37 (defun gnus-custom-mode ()
38   "Major mode for editing Gnus customization buffers.
39
40 The following commands are available:
41
42 \\[widget-forward]              Move to next button or editable field.
43 \\[widget-backward]             Move to previous button or editable field.
44 \\[widget-button-click]         Activate button under the mouse pointer.
45 \\[widget-button-press]         Activate button under point.
46
47 Entry to this mode calls the value of `gnus-custom-mode-hook'
48 if that value is non-nil."
49   (kill-all-local-variables)
50   (setq major-mode 'gnus-custom-mode
51         mode-name "Gnus Customize")
52   (use-local-map widget-keymap)
53   ;; Emacs 21 stuff:
54   (when (and (facep 'custom-button-face)
55              (facep 'custom-button-pressed-face))
56     (set (make-local-variable 'widget-button-face)
57          'custom-button-face)
58     (set (make-local-variable 'widget-button-pressed-face)
59          'custom-button-pressed-face)
60     (set (make-local-variable 'widget-mouse-face)
61          'custom-button-pressed-face))
62   (when (and (boundp 'custom-raised-buttons)
63              (symbol-value 'custom-raised-buttons))
64     (set (make-local-variable 'widget-push-button-prefix) "")
65     (set (make-local-variable 'widget-push-button-suffix) "")
66     (set (make-local-variable 'widget-link-prefix) "")
67     (set (make-local-variable 'widget-link-suffix) ""))
68   (gnus-run-mode-hooks 'gnus-custom-mode-hook))
69
70 ;;; Group Customization:
71
72 (defconst gnus-group-parameters
73   '((extra-aliases (choice
74                     :tag "Extra Aliases"
75                     (list
76                      :tag "List"
77                      (editable-list
78                       :inline t
79                       (gnus-email-address :tag "Address")))
80                     (gnus-email-address :tag "Address")) "\
81 Store messages posted from or to this address in this group.
82
83 You must be using gnus-group-split for this to work.  The VALUE of the
84 nnmail-split-fancy SPLIT generated for this group will match these
85 addresses.")
86
87     (split-regexp (regexp :tag "gnus-group-split Regular Expression") "\
88 Like gnus-group-split Address, but expects a regular expression.")
89
90     (split-exclude (list :tag "gnus-group-split Restricts"
91                          (editable-list
92                           :inline t (regexp :tag "Restrict"))) "\
93 Regular expression that cancels gnus-group-split matches.
94
95 Each entry is added to the nnmail-split-fancy SPLIT as a separate
96 RESTRICT clause.")
97
98     (split-spec (choice :tag "gnus-group-split Overrider"
99                         (sexp :tag "Fancy Split")
100                         (const :tag "Catch All" catch-all)
101                         (const :tag "Ignore" nil)) "\
102 Override all other gnus-group-split fields.
103
104 In `Fancy Split', you can enter any nnmail-split-fancy SPLIT.  Note
105 that the name of this group won't be automatically assumed, you have
106 to add it to the SPLITs yourself.  This means you can use such splits
107 to split messages to other groups too.
108
109 If you select `Catch All', this group will get postings for any
110 messages not matched in any other group.  It overrides the variable
111 gnus-group-split-default-catch-all-group.
112
113 Selecting `Ignore' forces no SPLIT to be generated for this group,
114 disabling all other gnus-group-split fields.")
115
116     (broken-reply-to (const :tag "Broken Reply To" t) "\
117 Ignore `Reply-To' headers in this group.
118
119 That can be useful if you're reading a mailing list group where the
120 listserv has inserted `Reply-To' headers that point back to the
121 listserv itself.  This is broken behavior.  So there!")
122
123     (to-group (string :tag "To Group") "\
124 All posts will be sent to the specified group.")
125
126     (gcc-self (choice :tag  "GCC"
127                       :value t
128                       (const :tag "To current group" t)
129                       (const none)
130                       (string :format "%v" :hide-front-space t)) "\
131 Specify default value for GCC header.
132
133 If this symbol is present in the group parameter list and set to t,
134 new composed messages will be `Gcc''d to the current group.  If it is
135 present and set to `none', no `Gcc:' header will be generated, if it
136 is present and a string, this string will be inserted literally as a
137 `gcc' header (this symbol takes precedence over any default `Gcc'
138 rules as described later).")
139
140     (expiry-wait (choice :tag  "Expire Wait"
141                          :value never
142                          (const never)
143                          (const immediate)
144                          (number :hide-front-space t
145                                  :format "%v")) "\
146 When to expire.
147
148 Overrides any `nnmail-expiry-wait' and `nnmail-expiry-wait-function'
149 when expiring expirable messages.  The value can either be a number of
150 days (not necessarily an integer) or the symbols `never' or
151 `immediate'.")
152
153     (expiry-target (choice :tag "Expiry Target"
154                            :value delete
155                            (const delete)
156                            (function :format "%v" nnmail-)
157                            string) "\
158 Where expired messages end up.
159
160 Overrides `nnmail-expiry-target'.")
161
162     (score-file (file :tag "Score File") "\
163 Make the specified file into the current score file.
164 This means that all score commands you issue will end up in this file.")
165
166     (adapt-file (file :tag "Adapt File") "\
167 Make the specified file into the current adaptive file.
168 All adaptive score entries will be put into this file.")
169
170     (admin-address (gnus-email-address :tag "Admin Address") "\
171 Administration address for a mailing list.
172
173 When unsubscribing to a mailing list you should never send the
174 unsubscription notice to the mailing list itself.  Instead, you'd
175 send messages to the administrative address.  This parameter allows
176 you to put the admin address somewhere convenient.")
177
178     (display (choice :tag "Display"
179                      :value default
180                      (const all)
181                      (integer)
182                      (const default)
183                      (sexp  :tag "Other")) "\
184 Which articles to display on entering the group.
185
186 `all'
187      Display all articles, both read and unread.
188
189 `integer'
190      Display the last NUMBER articles in the group.  This is the same as
191      entering the group with C-u NUMBER.
192
193 `default'
194      Display the default visible articles, which normally includes
195      unread and ticked articles.
196
197 `Other'
198      Display the articles that satisfy the S-expression. The S-expression
199      should be in an array form.")
200
201     (comment (string :tag  "Comment") "\
202 An arbitrary comment on the group.")
203