32fb78e12efc96a12646523fbb9e77dde85047bd
[gnus] / lisp / gnus-cus.el
1 ;; gnus-cus.el --- User friendly customization of Gnus
2 ;; Copyright (C) 1995 Free Software Foundation, Inc.
3 ;;
4 ;; Author: Per Abrahamsen <abraham@iesd.auc.dk>
5 ;; Keywords: help, news
6 ;; Version: 0.1
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 2, or (at your option)
13 ;; 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; see the file COPYING.  If not, write to
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23
24 ;;; Commentary:
25
26 ;;; Code:
27
28 (require 'custom)
29 (require 'gnus-ems)
30
31 ;; The following is just helper functions and data, not ment to be set
32 ;; by the user.
33 (defun gnus-make-face (color)
34   ;; Create entry for face with COLOR.
35   (custom-face-lookup color nil nil nil nil nil))
36
37 (defvar gnus-face-light-name-list
38   '("light blue" "light cyan" "light yellow" "light pink"
39     "pale green" "beige" "orange" "magenta" "violet" "medium purple"
40     "turquoise"))
41
42 (defvar gnus-face-dark-name-list
43   '("blue" "firebrick"
44     "dark green" "dark orange" "dark khaki" "dark violet"
45     "dark turquoise"))
46
47 (custom-declare '()
48   '((tag . "GNUS")
49     (doc . "\
50 The coffe-brewing, all singing, all dancing, kitchen sink newsreader.")
51     (type . group)
52     (data ((tag . "Visual")
53            (doc . "\
54 GNUS can be made colorful and fun or grey and dull as you wish.")
55            (type . group)
56            (data ((tag . "Visual")
57                   (doc . "Enable visual features.
58 If `visual' is disabled, there will be no menus and few faces.  Most of
59 the visual customization options below will be ignored.  GNUS will use
60 less space and be faster as a result.")
61                   (default . t)
62                   (name . gnus-visual)
63                   (type . toggle))
64                  ((tag . "WWW Browser")
65                   (doc . "\
66 WWW Browser to call when clicking on an URL button in the article buffer.
67
68 You can choose between one of the predefined browsers, or `Other'.")
69                   (name . gnus-button-url)
70                   (default . w3-fetch)
71                   (calculate . (cond ((boundp 'browse-url-browser-function)
72                                       browse-url-browser-function)
73                                      ((fboundp 'w3-fetch) 
74                                       'w3-fetch)
75                                      ((eq window-system 'x) 
76                                       'gnus-netscape-open-url)))
77                   (type . choice)
78                   (data ((tag . "W3")
79                          (type . const)
80                          (default . w3-fetch))
81                         ((tag . "Netscape")
82                          (type . const)
83                          (default . gnus-netscape-open-url))
84                         ((prompt . "Other")
85                          (doc . "\
86 You must specify the name of a Lisp function here.  The lisp function
87 should open a WWW browser when called with an URL (a string).
88 ")
89                          (default . __uninitialized__)
90                          (type . symbol))))
91                  ((tag . "Mouse Face")
92                   (doc . "\
93 Face used for group or summary buffer mouse highlighting.
94 The line beneath the mouse pointer will be highlighted with this
95 face.")
96                   (name . gnus-mouse-face)
97                   (calculate . (if (boundp 'gnus-mouse-face)
98                                     gnus-mouse-face
99                                   'highlight))
100                   (type . face))
101                  ((tag . "Article Display")
102                   (doc . "Controls how the article buffer will look.
103
104 The list below contains various filters you can use to change the look
105 of the article.  If you leave the list empty, the article will appear
106 exactly as it is stored on the disk.  The list entries will hide or
107 highlight various parts of the article, making it easier to find the
108 information you want.")
109                   (name . gnus-article-display-hook)
110                   (type . list)
111                   (default . (gnus-article-hide-headers-if-wanted
112                               gnus-article-treat-overstrike
113                               gnus-article-maybe-highlight))
114                   (data ((type . repeat)
115                          (header . nil)
116                          (data (tag . "Filter")
117                                (type . choice)
118                                (data ((tag . "Treat Overstrike")
119                                       (doc . "\
120 Convert use of overstrike into bold and underline.
121
122 Two identical letters separated by a backspace are displayed as a
123 single bold letter, while a letter followed by a backspace and an
124 underscore will be displayed as a single underlined letter.  This
125 technique was developed for old line printers (think about it), and is
126 still in use on some newsgroups, in particular the ClariNet
127 hierearchy.
128 ")
129                                       (type . const)
130                                       (default . 
131                                         gnus-article-treat-overstrike))
132                                      ((tag . "Word Wrap")
133                                       (doc . "\
134 Format too long lines.
135 ")
136                                       (type . const)
137                                       (default . gnus-article-word-wrap))
138                                      ((tag . "Remove CR")
139                                       (doc . "\
140 Remove carriage returns from an article.
141 ")
142                                       (type . const)
143                                       (default . gnus-article-remove-cr))
144                                      ((tag . "Display X-Face")
145                                       (doc . "\
146 Look for an X-Face header and display it if present.
147
148 See also `X Face Command' for a definition of the external command
149 used for decoding and displaying the face.
150 ")
151                                       (type . const)
152                                       (default . gnus-article-display-x-face))
153                                      ((tag . "Unquote Printable")
154                                       (doc . "\
155 Tranform MIME quoted printable into 8-bit characters.
156
157 Quoted printable is often seen by strings like `=EF' where you would
158 expect a non-English letter.
159 ")
160                                       (type . const)
161                                       (default .
162                                         gnus-article-de-quoted-unreadable))
163                                      ((tag . "Universal Time")
164                                       (doc . "\
165 Convert date header to universal time.
166 ")
167                                       (type . const)
168                                       (default . gnus-article-date-ut))
169                                      ((tag . "Local Time")
170                                       (doc . "\
171 Convert date header to local timezone.
172 ")
173                                       (type . const)
174                                       (default . gnus-article-date-local))
175                                      ((tag . "Lapsed Time")
176                                       (doc . "\
177 Replace date header with a header showing the articles age.
178 ")
179                                       (type . const)
180                                       (default . gnus-article-date-lapsed))
181                                      ((tag . "Highlight")
182                                       (doc . "\
183 Highlight headers, citations, signature, and buttons.
184 ")
185                                       (type . const)
186                                       (default . gnus-article-highlight))
187                                      ((tag . "Maybe Highlight")
188                                       (doc . "\
189 Highlight headers, signature, and buttons if `Visual' is turned on.
190 ")
191                                       (type . const)
192                                       (default . 
193                                         gnus-article-maybe-highlight))
194                                      ((tag . "Highlight Some")
195                                       (doc . "\
196 Highlight headers, signature, and buttons.
197 ")
198                                       (type . const)
199                                       (default . gnus-article-highlight-some))
200                                      ((tag . "Highlight Headers")
201                                       (doc . "\
202 Highlight headers as specified by `Article Header Highligting'.
203 ")
204                                       (type . const)
205                                       (default .
206                                         gnus-article-highlight-headers))
207                                      ((tag . "Highlight Signature")
208                                       (doc . "\
209 Highlight the signature as specified by `Article Signature Face'.
210 ")
211                                       (type . const)
212                                       (default .
213                                         gnus-article-highlight-signature))
214                                      ((tag . "Citation")
215                                       (doc . "\
216 Highlight the citations as specified by `Citation Faces'.
217 ")
218                                       (type . const)
219                                       (default . 
220                                         gnus-article-highlight-citation))
221                                      ((tag . "Hide")
222                                       (doc . "\
223 Hide unwanted headers, excess citation, and the signature.
224 ")
225                                       (type . const)
226                                       (default . gnus-article-hide))
227                                      ((tag . "Hide Headers If Wanted")
228                                       (doc . "\
229 Hide headers, but allow user to display them with `t' or `v'.
230 ")
231                                       (type . const)
232                                       (default . 
233                                         gnus-article-hide-headers-if-wanted))
234                                      ((tag . "Hide Headers")
235                                       (doc . "\
236 Hide unwanted headers and possibly sort them as well.
237 Most likely you want to use `Hide Headers If Wanted' instead.
238 ")
239                                       (type . const)
240                                       (default . gnus-article-hide-headers))
241                                      ((tag . "Hide Signature")
242                                       (doc . "\
243 Hide the signature.
244 ")
245                                       (type . const)
246                                       (default . gnus-article-hide-signature))
247                                      ((tag . "Hide Excess Citations")
248                                       (doc . "\
249 Hide excess citation.
250
251 Excess is defined by `Citation Hide Percentage' and `Citation Hide Absolute'.
252 ")
253                                       (type . const)
254                                       (default . 
255                                         gnus-article-hide-citation-maybe))
256                                      ((tag . "Hide Citations")
257                                       (doc . "\
258 Hide all cited text.
259 ")
260                                       (type . const)
261                                       (default . gnus-article-hide-citation))
262                                      ((tag . "Add Buttons")
263                                       (doc . "\
264 Make URL's into clickable buttons.
265 ")
266                                       (type . const)
267                                       (default . gnus-article-add-buttons))
268                                      ((prompt . "Other")
269                                       (doc . "\
270 Name of Lisp function to call.
271
272 Push the `Filter' button to select one of the predefined filters.
273 ")
274                                       (type . symbol)))))))
275                  ((tag . "Article Button Face")
276                   (doc . "\
277 Face used for highlighting buttons in the article buffer.
278
279 An article button is a piece of text that you can activate by pressing
280 `RET' or `mouse-2' above it.")
281                   (name . gnus-article-button-face)
282                   (default . bold)
283                   (type . face))
284                  ((tag . "Article Mouse Face")
285                   (doc . "\
286 Face used for mouse highlighting in the article buffer.
287
288 Article buttons will be displayed in this face when the cursor is
289 above them.")
290                   (name . gnus-article-mouse-face)
291                   (default . highlight)
292                   (type . face))
293                  ((tag . "Article Signature Face")
294                   (doc . "\
295 Face used for highlighting a signature in the article buffer.")
296                   (name . gnus-signature-face)
297                   (default . italic)
298                   (type . face))
299                  ((tag . "Article Header Highlighting")
300                   (doc . "\
301 Controls highlighting of article header.
302
303 Below is a list of article header names, and the faces used for
304 displaying the name and content of the header.  The `Header' field
305 should contain the name of the header.  The field actually contains a
306 regular expression that should match the beginning of the header line,
307 but if you don't know what a regular expression is, just write the
308 name of the header.  The second field is the `Name' field, which
309 determines how the the header name (i.e. the part of the header left
310 of the `:') is displayed.  The third field is the `Content' field,
311 which determines how the content (i.e. the part of the header right of
312 the `:') is displayed.  
313