*** empty log message ***
[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
30 (custom-declare '()
31   '((tag . "GNUS")
32     (doc . "\
33 The coffe-brewing, all singing, all dancing, kitchen sink newsreader.")
34     (type . group)
35     (data ((tag . "Visual")
36            (doc . "\
37 GNUS can be made colorful and fun or grey and dull as you wish.")
38            (type . group)
39            (data ((tag . "Visual")
40                   (doc . "Enable visual features.
41 If `visual' is disabled, there will be no menus and few faces.  Most of
42 the visual customization options below will be ignored.  GNUS will use
43 less space and be faster as a result.")
44                   (default . t)
45                   (name . gnus-visual)
46                   (type . toggle))
47                  ((tag . "WWW Browser")
48                   (doc . "\
49 WWW Browser to call when clicking on an URL button in the article buffer.
50
51 You can choose between one of the predefined browsers, or `Other'.")
52                   (name . gnus-button-url)
53                   (default . w3-fetch)
54                   (type . choice)
55                   (data ((tag . "W3")
56                          (type . const)
57                          (default . w3-fetch))
58                         ((tag . "Netscape")
59                          (type . const)
60                          (default . gnus-netscape-open-url))
61                         ((prompt . "Other")
62                          (doc . "\
63 You must specify the name of a Lisp function here.  The lisp function
64 should open a WWW browser when called with an URL (a string).
65 ")
66                          (default . __uninitialized__)
67                          (type . symbol))))
68                  ((tag . "Mouse Face")
69                   (doc . "\
70 Face used for group or summary buffer mouse highlighting.
71 The line beneath the mouse pointer will be highlighted with this
72 face.")
73                   (name . gnus-mouse-face)
74                   (default . highlight)
75                   (type . face))
76                  ((tag . "Article Display")
77                   (doc . "Controls how the article buffer will look.
78
79 The list below contains various filters you can use to change the look
80 of the article.  If you leave the list empty, the article will appear
81 exactly as it is stored on the disk.  The list entries will hide or
82 highlight various parts of the article, making it easier to find the
83 information you want.")
84                   (name . gnus-article-display-hook)
85                   (type . list)
86                   (default . (gnus-article-hide-headers-if-wanted
87                               gnus-article-treat-overstrike
88                               gnus-article-maybe-highlight))
89                   (data ((type . repeat)
90                          (header . nil)
91                          (data (tag . "Filter")
92                                (type . choice)
93                                (data ((tag . "Treat Overstrike")
94                                       (doc . "\
95 Convert use of overstrike into bold and underline.
96
97 Two identical letters separated by a backspace are displayed as a
98 single bold letter, while a letter followed by a backspace and an
99 underscore will be displayed as a single underlined letter.  This
100 technique was developed for old line printers (think about it), and is
101 still in use on some newsgroups, in particular the ClariNet
102 hierearchy.
103 ")
104                                       (type . const)
105                                       (default . 
106                                         gnus-article-treat-overstrike))
107                                      ((tag . "Word Wrap")
108                                       (doc . "\
109 Format too long lines.
110 ")
111                                       (type . const)
112                                       (default . gnus-article-word-wrap))
113                                      ((tag . "Remove CR")
114                                       (doc . "\
115 Remove carriage returns from an article.
116 ")
117                                       (type . const)
118                                       (default . gnus-article-remove-cr))
119                                      ((tag . "Display X-Face")
120                                       (doc . "\
121 Look for an X-Face header and display it if present.
122
123 See also `X Face Command' for a definition of the external command
124 used for decoding and displaying the face.
125 ")
126                                       (type . const)
127                                       (default . gnus-article-display-x-face))
128                                      ((tag . "Unquote Printable")
129                                       (doc . "\
130 Tranform MIME quoted printable into 8-bit characters.
131
132 Quoted printable is often seen by strings like `=EF' where you would
133 expect a non-English letter.
134 ")
135                                       (type . const)
136                                       (default .
137                                         gnus-article-de-quoted-unreadable))
138                                      ((tag . "Universal Time")
139                                       (doc . "\
140 Convert date header to universal time.
141 ")
142                                       (type . const)
143                                       (default . gnus-article-date-ut))
144                                      ((tag . "Local Time")
145                                       (doc . "\
146 Convert date header to local timezone.
147 ")
148                                       (type . const)
149                                       (default . gnus-article-date-local))
150                                      ((tag . "Lapsed Time")
151                                       (doc . "\
152 Replace date header with a header showing the articles age.
153 ")
154                                       (type . const)
155                                       (default . gnus-article-date-lapsed))
156                                      ((tag . "Highlight")
157                                       (doc . "\
158 Highlight headers, citations, signature, and buttons.
159 ")
160                                       (type . const)
161                                       (default . gnus-article-highlight))
162                                      ((tag . "Maybe Highlight")
163                                       (doc . "\
164 Highlight headers, signature, and buttons if `Visual' is turned on.
165 ")
166                                       (type . const)
167                                       (default . 
168                                         gnus-article-maybe-highlight))
169                                      ((tag . "Highlight Some")
170                                       (doc . "\
171 Highlight headers, signature, and buttons.
172 ")
173                                       (type . const)
174                                       (default . gnus-article-highlight-some))
175                                      ((tag . "Highlight Headers")
176                                       (doc . "\
177 Highlight headers as specified by `Article Header Highligting'.
178 ")
179                                       (type . const)
180                                       (default .
181                                         gnus-article-highlight-headers))
182                                      ((tag . "Highlight Signature")
183                                       (doc . "\
184 Highlight the signature as specified by `Article Signature Face'.
185 ")
186                                       (type . const)
187                                       (default .
188                                         gnus-article-highlight-signature))
189                                      ((tag . "Citation")
190                                       (doc . "\
191 Highlight the citations as specified by `Citation Faces'.
192 ")
193                                       (type . const)
194                                       (default . 
195                                         gnus-article-highlight-citation))
196                                      ((tag . "Hide")
197                                       (doc . "\
198 Hide unwanted headers, excess citation, and the signature.
199 ")
200                                       (type . const)
201                                       (default . gnus-article-hide))
202                                      ((tag . "Hide Headers If Wanted")
203                                       (doc . "\
204 Hide headers, but allow user to display them with `t' or `v'.
205 ")
206                                       (type . const)
207                                       (default . 
208                                         gnus-article-hide-headers-if-wanted))
209                                      ((tag . "Hide Headers")
210                                       (doc . "\
211 Hide unwanted headers and possibly sort them as well.
212 Most likely you want to use `Hide Headers If Wanted' instead.
213 ")
214                                       (type . const)
215                                       (default . gnus-article-hide-headers))
216                                      ((tag . "Hide Signature")
217                                       (doc . "\
218 Hide the signature.
219 ")
220                                       (type . const)
221                                       (default . gnus-article-hide-signature))
222                                      ((tag . "Hide Excess Citations")
223                                       (doc . "\
224 Hide excess citation.
225
226 Excess is defined by `Citation Hide Percentage' and `Citation Hide Absolute'.
227 ")
228                                       (type . const)
229                                       (default . 
230                                         gnus-article-hide-citation-maybe))
231                                      ((tag . "Hide Citations")
232                                       (doc . "\
233 Hide all cited text.
234 ")
235                                       (type . const)
236                                       (default . gnus-article-hide-citation))
237                                      ((tag . "Add Buttons")
238                                       (doc . "\
239 Make URL's into clickable buttons.
240 ")
241                                       (type . const)
242                                       (default . gnus-article-add-buttons))
243                                      ((prompt . "Other")
244                                       (doc . "\
245 Name of Lisp function to call.
246
247 Push the `Filter' button to select one of the predefined filters.
248 ")
249                                       (type . symbol)))))))
250                  ((tag . "Article Button Face")
251                   (doc . "\
252 Face used for highlighting buttons in the article buffer.
253
254 An article button is a piece of text that you can activate by pressing
255 `RET' or `mouse-2' above it.")
256                   (name . gnus-article-button-face)
257                   (default . bold)
258                   (type . face))
259                  ((tag . "Article Mouse Face")
260                   (doc . "\
261 Face used for mouse highlighting in the article buffer.
262
263 Article buttons will be displayed in this face when the cursor is
264 above them.")
265                   (name . gnus-article-mouse-face)
266                   (default . highlight)
267                   (type . face))
268                  ((tag . "Article Signature Face")
269                   (doc . "\
270 Face used for highlighting a signature in the article buffer.")
271                   (name . gnus-signature-face)
272                   (default . italic)
273                   (type . face))
274                  ((tag . "Article Header Highlighting")
275                   (doc . "\
276 Controls highlighting of article header.
277
278 Below is a list of article header names, and the faces used for
279 displaying the name and content of the header.  The `Header' field
280 should contain the name of the header.  The field actually contains a
281 regular expression that should match the beginning of the header line,
282 but if you don't know what a regular expression is, just write the
283 name of the header.  The second field is the `Name' field, which
284 determines how the the header name (i.e. the part of the header left
285 of the `:') is displayed.  The third field is the `Content' field,
286 which determines how the content (i.e. the part of the header right of
287 the `:') is displayed.  
288
289 If you leave the last `Header' field in the list empty, the `Name' and
290 `Content' fields will determine how headers not listed above are
291 displayed.  
292
293 If you only want to change the display of the name part for a specific
294 header, specify `None' in the `Content' field.  Similarly, specify
295 `None' in the `Name' field if you only want to leave the name part
296 alone.")
297                   (name . gnus-header-face-alist)
298                   (type . list)
299                   (default . (("" bold italic)))
300                   (data ((type . repeat)
301                          (header . nil)
302                          (data (type . list)
303                                (compact . t)
304                                (data ((type . string)
305                                       (prompt . "Header")
306                                       (tag . "Header "))
307                                      "\n            "
308                                      ((type . face)
309                                       (prompt . "Name")
310                                       (tag . "Name   "))
311                                      "\n            "
312                                      ((type . face)
313                                       (tag . "Content"))
314                                      "\n")))))
315                  ((tag . "Attribution Face")
316                   (doc . "\
317 Face used for attribution lines.
318 It is merged with the face for the cited text belonging to the attribution.")
319                   (name . gnus-cite-attribution-face)
320                   (default . underline)
321                   (type . face))
322                  ((tag . "Citation Faces")
323                   (doc . "\
324 List of faces used for highlighting citations. 
325
326 When there are citations from multiple articles in the same message,
327 Gnus will try to give each citation from each article its own face.
328 This should make it easier to see who wrote what.")
329                   (name . gnus-cite-face-list)
330                   (type . list)
331                   (default . (italic))
332                   (data ((type . repeat)
333                          (header . nil)
334                          (data (type . face)
335                                (tag . "Face")))))
336                  ((tag . "Citation Hide Percentage")
337                   (doc . "\
338 Only hide excess citation if above this percentage of the body.")
339                   (name . gnus-cite-hide-percentage)
340                   (default . 50)
341                   (type . integer))
342                  ((tag . "Citation Hide Absolute")
343                   (doc . "\
344 Only hide excess citation if above this number of lines in the body.")
345                   (name . gnus-cite-hide-absolute)
346                   (default . 10)
347                   (type . integer))
348                  ((tag . "Summary Selected Face")
349                   (doc . "\
350 Face used for highlighting the current article in the summary buffer.")
351                   (name . gnus-summary-selected-face)
352                   (default . underline)
353                   (type . face))
354                  ((tag . "Summary Line Highlighting")
355                   (doc . "\
356 Controls the higlighting of summary buffer lines. 
357
358 Below is a list of `Form'/`Face' pairs.  When deciding how a a
359 particular summary line should be displayed, each form is
360 evaluated. The content of the face field after the first true form is
361 used.  You can change how those summary lines are displayed, by
362 editing the face field.  
363
364 It is also possible to change and add form fields, but currently that
365 requires an understanding of Lisp expressions.  Hopefully this will
366 change in a future release.  For now, you can use the following
367 variables in the Lisp expression:
368
369 score:   The article's score
370 default: The default article score.
371 below:   The score below which articles are automatically marked as read. 
372 mark:    The article's mark.")
373                   (name . gnus-summary-highlight)
374                   (type . list)
375                   (default . (((> score default) . bold)
376                               ((< score default) . italic)))
377                   (data ((type . repeat)
378                          (header . nil)
379                          (data (type . pair)
380                                (compact . t)
381                                (data ((type . sexp)
382                                       (width . 60)
383                                       (tag . "Form"))
384                                      "\n            "
385                                      ((type . face)
386                                       (tag . "Face"))
387                                      "\n")))))
388                  ;; Do not define `gnus-button-alist' before we have
389                  ;; some `complexity' attribute so we can hide it from
390                  ;; beginners. 
391                  )))))
392
393 (defun gnus-custom-import-swap-alist (custom alist)
394   ;; Swap key and value in CUSTOM ALIST.
395   (let ((swap (mapcar (lambda (e) (cons (cdr e) (car e))) alist)))
396     (funcall (custom-super custom 'import) custom swap)))
397
398 (defun gnus-custom-export-swap-alist (custom alist)
399   ;; Swap key and value in CUSTOM ALIST.
400   (let ((swap (mapcar (lambda (e) (cons (cdr e) (car e))) alist)))
401     (funcall (custom-super custom 'export) custom swap)))
402
403 (provide 'gnus-cus)
404
405 ;;; gnus-cus.el ends here
406
407