* mm-util.el (mm-line-number-at-pos): New function.
[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 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&nb