Cleanup uses of "-hooks"
[gnus] / lisp / gnus-cus.el
1 ;;; gnus-cus.el --- customization commands for Gnus
2
3 ;; Copyright (C) 1996, 1999-2012 Free Software Foundation, Inc.
4
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6 ;; Keywords: news
7
8 ;; This file is part of GNU Emacs.
9
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.
14
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.
19
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/>.
22
23 ;;; Commentary:
24
25 ;;; Code:
26
27 (require 'wid-edit)
28 (require 'gnus)
29 (require 'gnus-agent)
30 (require 'gnus-score)
31 (require 'gnus-topic)
32 (require 'gnus-art)
33
34 ;;; Widgets:
35
36 (defun gnus-custom-mode ()
37   "Major mode for editing Gnus customization buffers.
38
39 The following commands are available:
40
41 \\[widget-forward]              Move to next button or editable field.
42 \\[widget-backward]             Move to previous button or editable field.
43 \\[widget-button-click]         Activate button under the mouse pointer.
44 \\[widget-button-press]         Activate button under point.
45
46 Entry to this mode calls the value of `gnus-custom-mode-hook'
47 if that value is non-nil."
48   (kill-all-local-variables)
49   (setq major-mode 'gnus-custom-mode
50         mode-name "Gnus Customize")
51   (use-local-map widget-keymap)
52   ;; Emacs stuff:
53   (when (and (facep 'custom-button-face)
54              (facep 'custom-button-pressed-face))
55     (set (make-local-variable 'widget-button-face)
56          'custom-button-face)
57     (set (make-local-variable 'widget-button-pressed-face)
58          'custom-button-pressed-face)
59     (set (make-local-variable 'widget-mouse-face)
60          'custom-button-pressed-face))
61   (when (and (boundp 'custom-raised-buttons)
62              (symbol-value 'custom-raised-buttons))
63     (set (make-local-variable 'widget-push-button-prefix) "")
64     (set (make-local-variable 'widget-push-button-suffix) "")
65     (set (make-local-variable 'widget-link-prefix) "")
66     (set (make-local-variable 'widget-link-suffix) ""))
67   (gnus-run-mode-hooks 'gnus-custom-mode-hook))
68
69 ;;; Group Customization:
70
71 (defconst gnus-group-parameters
72   '((extra-aliases (choice
73                     :tag "Extra Aliases"
74                     (list
75                      :tag "List"
76                      (editable-list
77                       :inline t
78                       (gnus-email-address :tag "Address")))
79                     (gnus-email-address :tag "Address")) "\
80 Store messages posted from or to this address in this group.
81
82 You must be using gnus-group-split for this to work.  The VALUE of the
83 nnmail-split-fancy SPLIT generated for this group will match these
84 addresses.")
85
86     (split-regexp (regexp :tag "gnus-group-split Regular Expression") "\
87 Like gnus-group-split Address, but expects a regular expression.")
88