*** empty log message ***
[gnus] / lisp / gnus-cus.el
1 ;;; gnus-cus.el --- customization commands for Gnus
2 ;;
3 ;; Copyright (C) 1996 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 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 the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Commentary:
26
27 ;;; Code:
28
29 (require 'wid-edit)
30 (require 'gnus-score)
31 (require 'gnus-topic)
32
33 ;;; Widgets:
34
35 ;; There should be special validation for this.
36 (define-widget 'gnus-email-address 'string
37   "An email address")
38
39 (defun gnus-custom-mode ()
40   "Major mode for editing Gnus customization buffers.
41
42 The following commands are available:
43
44 \\[widget-forward]              Move to next button or editable field.
45 \\[widget-backward]             Move to previous button or editable field.
46 \\[widget-button-click]         Activate button under the mouse pointer.
47 \\[widget-button-press]         Activate button under point.
48
49 Entry to this mode calls the value of `gnus-custom-mode-hook'
50 if that value is non-nil."
51   (kill-all-local-variables)
52   (setq major-mode 'gnus-custom-mode
53         mode-name "Gnus Customize")
54   (use-local-map widget-keymap)
55   (gnus-run-hooks 'gnus-custom-mode-hook))
56
57 ;;; Group Customization:
58
59 (defconst gnus-group-parameters
60   '((to-address (gnus-email-address :tag "To Address") "\
61 This will be used when doing followups and posts.
62
63 This is primarily useful in mail groups that represent closed
64 mailing lists--mailing lists where it's expected that everybody that
65 writes to the mailing list is subscribed to it.  Since using this
66 parameter ensures that the mail only goes to the mailing list itself,
67 it means that members won't receive two copies of your followups.
68
69 Using `to-address' will actually work whether the group is foreign or
70 not.  Let's say there's a group on the server that is called
71 `fa.4ad-l'.  This is a real newsgroup, but the server has gotten the
72 articles from a mail-to-news gateway.  Posting directly to this group
73 is therefore impossible--you have to send mail to the mailing list
74 address instead.")
75
76     (to-list (gnus-email-address :tag "To List") "\
77 This address will be used when doing a `a' in the group.
78
79 It is totally ignored when doing a followup--except that if it is
80 present in a news group, you'll get mail group semantics when doing
81 `f'.")
82
83     (broken-reply-to (const :tag "Broken Reply To" t) "\
84 Ignore `Reply-To' headers in this group.
85
86 That can be useful if you're reading a mailing list group where the
87 listserv has inserted `Reply-To' headers that point back to the
88 listserv itself.  This is broken behavior.  So there!")
89
90     (to-group (string :tag "To Group") "\
91 All posts will be send to the specified group.")
92
93     (gcc-self (choice :tag  "GCC"
94                       :value t
95                       (const t)
96                       (const none)
97                       (string :format "%v" :hide-front-space t)) "\
98 Specify default value for GCC header.
99
100 If this symbol is present in the group parameter list and set to `t',
101 new composed messages will be `Gcc''d to the current group. If it is
102 present and set to `none', no `Gcc:' header will be generated, if it
103 is present and a string, this string will be inserted literally as a
104 `gcc' header (this symbol takes precedence over any default `Gcc'
105 rules as described later).")
106
107     (banner (choice :tag "Banner"
108                     (const signature)
109                     string ) "\
110 Banner to be removed from articles.")
111
112     (auto-expire (const :tag "Automatic Expire" t) "\
113 All articles that are read will be marked as expirable.")
114
115     (total-expire (const :tag "Total Expire" t) "\
116 All read articles will be put through the expiry process
117
118 This happens even if they are not marked as expirable.
119 Use with caution.")
120
121     (expiry-wait (choice :tag  "Expire Wait"
122                          :value never
123                          (const never)
124                          (const immediate)
125                          (number :hide-front-space t
126                                  :format "%v")) "\
127 When to expire.
128
129 Overrides any `nnmail-expiry-wait' and `nnmail-expiry-wait-function'
130 when expiring expirable messages. The value can either be a number of
131 days (not necessarily an integer) or the symbols `never' or
132 `immediate'.")
133
134     (score-file (file :tag "Score File") "\
135 Make the specified file into the current score file.
136 This means that all score commands you issue will end up in this file.")
137
138     (adapt-file (file :tag "Adapt File") "\
139 Make the specified file into the current adaptive file.
140 All adaptive score entries will be put into this file.")
141
142     (admin-address (gnus-email-address :tag "Admin Address") "\
143 Administration address for a mailing list.
144
145 When unsubscribing to a mailing list you should never send the
146 unsubscription notice to the mailing list itself.  Instead, you'd
147 send messages to the administrative address.  This parameter allows
148 you to put the admin address somewhere convenient.")
149
150     (display (choice :tag "Display"
151                      :value default
152                      (const all)
153                      (const default)) "\
154 Which articles to display on entering the group.
155
156 `all'
157      Display all articles, both read and unread.
158
159 `default'
160      Display the default visible articles, which normally includes
161      unread and ticked articles.")
162
163     (comment (string :tag  "Comment") "\
164 An arbitrary comment on the group.")
165
166     (visible (const :tag "Permanently visible" t) "\
167 Always display this group, even when there are no unread articles
168 in it..")
169
170     (charset (symbol :tag "Charset") "\
171 The default charset to use in the group.")
172              
173     (highlight-words 
174      (choice :tag "Highlight words"
175              :value nil
176              (repeat (list (regexp :tag "Highlight regexp")
177                            (number :tag "Group for entire word" 0)
178                            (number :tag "Group for displayed part" 0)
179                            (symbol :tag "Face" 
180                                    gnus-emphasis-highlight-words))))
181   "highlight regexps.
182 See gnus-emphasis-alist."))
183   "Alist of valid group parameters.
184
185 Each entry has the form (NAME TYPE DOC), where NAME is the parameter
186 itself (a symbol), TYPE is the parameters type (a sexp widget), and
187 DOC is a documentation string for the parameter.")
188
189 (defvar gnus-custom-params)
190 (defvar gnus-custom-method)
191 (defvar gnus-custom-group)
192 (defvar gnus-custom-topic)
193
194 (defun gnus-group-customize (group &optional topic)
195   "Edit the group or topic on the current line."
196   (interactive (list (gnus-group-group-name) (gnus-group-topic-name)))
197   (let (info
198         (types (mapcar (lambda (entry)
199                          `(cons :format "%v%h\n"
200                                 :doc ,(nth 2 entry)
201                                 (const :format "" ,(nth 0 entry))
202                                 ,(nth 1 entry)))
203                        gnus-group-parameters)))
204     (unless (or group topic)
205       (error "No group on current line"))
206     (when (and group topic)
207       (error "Both a group an topic on current line"))
208     (unless (or topic (setq info (gnus-get-info group)))
209       (error "Killed group; can't be edited"))
210     ;; Ready.
211     (kill-buffer (gnus-get-buffer-create "*Gnus Customize*"))
212     (switch-to-buffer (gnus-get-buffer-create "*Gnus Customize*"))
213     (gnus-custom-mode)
214     (make-local-variable 'gnus-custom-group)
215     (setq gnus-custom-group group)
216     (make-local-variable 'gnus-custom-topic)
217     (setq gnus-custom-topic topic)
218     (widget-insert "Customize the ")
219     (if group
220         (widget-create 'info-link
221                        :help-echo "Push me to learn more."
222                        :tag "group parameters"
223                        "(gnus)Group Parameters")
224       (widget-create 'info-link
225                      :help-echo "Push me to learn more."
226                      :tag  "topic parameters"
227                      "(gnus)Topic Parameters"))
228     (widget-insert " for <")
229     (widget-insert (or group topic))
230     (widget-insert "> and press ")
231     (widget-create 'push-button
232                    :tag "done"
233                    :help-echo "Push me when done customizing."
234                    :action 'gnus-group-customize-done)
235     (widget-insert ".\n\n")
236     (make-local-variable 'gnus-custom-params)
237     (setq gnus-custom-params
238           (widget-create 'group
239                          :value (if group
240                                     (gnus-info-params info)
241                                   (gnus-topic-parameters topic))
242                          `(set :inline t
243                                :greedy t
244                                :tag "Parameters"
245                                :format "%t:\n%h%v"
246                                :doc "\
247 These special paramerters are recognized by Gnus.
248 Check the [ ] for the parameters you want to apply to this group or
249 to the groups in this topic, then edit the value to suit your taste."
250                                ,@types)
251                          '(repeat :inline t
252                                   :tag "Variables"
253                                   :format "%t:\n%h%v%i\n\n"
254                                   :doc "\
255 Set variables local to the group you are entering.
256
257 If you want to turn threading off in `news.answers', you could put
258 `(gnus-show-threads nil)' in the group parameters of that group.
259 `gnus-show-threads' will be made into a local variable in the summary
260 buffer you enter, and the form `nil' will be `eval'ed there.
261
262 This can also be used as a group-specific hook function, if you'd
263 like.  If you want to hear a beep when you enter a group, you could
264 put something like `(dummy-variable (ding))' in the parameters of that
265 group.  `dummy-variable' will be set to the result of the `(ding)'
266 form, but who cares?"
267                                   (cons :format "%v" :value (nil .  nil)
268                                          (symbol :tag "Variable")
269                                          (sexp :tag
270                                                "Value")))
271
272                          '(repeat :inline t
273                                   :tag "Unknown entries"
274                                   sexp)))
275     (when group
276       (widget-insert "\n\nYou can also edit the ")
277       (widget-create 'info-link
278                      :tag "select method"
279                      :help-echo "Push me to learn more about select methods."
280                      "(gnus)Select Methods")
281       (widget-insert " for the group.\n")
282       (setq gnus-custom-method
283             (widget-create 'sexp
284                            :tag "Method"
285                            :value (gnus-info-method info))))
286     (use-local-map widget-keymap)
287     (widget-setup)
288     (goto-char (point-min))))
289
290 (defun gnus-group-customize-done (&rest ignore)
291   "Apply changes and bury the buffer."
292   (interactive)
293   (if gnus-custom-topic
294       (gnus-topic-set-parameters gnus-custom-topic
295                                  (widget-value gnus-custom-params))
296     (gnus-group-edit-group-done 'params gnus-custom-group
297                                 (widget-value gnus-custom-params))
298     (gnus-group-edit-group-done 'method gnus-custom-group
299                                 (widget-value gnus-custom-method)))
300   (bury-buffer))
301
302 ;;; Score Customization:
303
304 (defconst gnus-score-parameters
305   '((mark (number :tag "Mark") "\
306 The value of this entry should be a number.
307 Any articles with a score lower than this number will be marked as read.")
308
309     (expunge (number :tag "Expunge") "\
310 The value of this entry should be a number.
311 Any articles with a score lower than this number will be removed from
312 the summary buffer.")
313
314     (mark-and-expunge (number :tag "Mark-and-expunge") "\
315 The value of this entry should be a number.
316 Any articles with a score lower than this number will be marked as
317 read and removed from the summary buffer.")
318
319     (thread-mark-and-expunge (number :tag "Thread-mark-and-expunge") "\
320 The value of this entry should be a number.
321 All articles that belong to a thread that has a total score below this
322 number will be marked as read and removed from the summary buffer.
323 `gnus-thread-score-function' says how to compute the total score
324 for a thread.")
325
326     (files (repeat :inline t :tag "Files" file) "\
327 The value of this entry should be any number of file names.
328 These files are assumed to be score files as well, and will be loaded
329 the same way this one was.")
330
331     (exclude-files (repeat :inline t :tag "Exclude-files" file) "\
332 The clue of this entry should be any number of files.
333 These files will not be loaded, even though they would normally be so,
334 for some reason or other.")
335
336     (eval (sexp :tag "Eval" :value nil) "\
337 The value of this entry will be `eval'el.
338 This element will be ignored when handling global score files.")
339
340     (read-only (boolean :tag "Read-only" :value t) "\
341 Read-only score files will not be updated or saved.
342 Global score files should feature this atom.")
343
344     (orphan (number :tag "Orphan") "\
345 The value of this entry should be a number.
346 Articles that do not have parents will get this number added to their
347 scores.  Imagine you follow some high-volume newsgroup, like
348 `comp.lang.c'.  Most likely you will only follow a few of the threads,
349 also want to see any new threads.
350
351 You can do this with the following two score file entries:
352
353      (orphan -500)
354      (mark-and-expunge -100)
355
356 When you enter the group the first time, you will only see the new
357 threads.  You then raise the score of the threads that you find
358 interesting (with `I T' or `I S'), and ignore (`C y') the rest.
359 Next time you enter the group, you will see new articles in the
360 interesting threads, plus any new threads.
361
362 I.e.---the orphan score atom is for high-volume groups where there
363 exist a few interesting threads which can't be found automatically
364 by ordinary scoring rules.")
365
366     (adapt (choice :tag "Adapt"
367                    (const t)
368                    (const ignore)
369                    (sexp :format "%v"
370                          :hide-front-space t)) "\
371 This entry controls the adaptive scoring.
372 If it is `t', the default adaptive scoring rules will be used.  If it
373 is `ignore', no adaptive scoring will be performed on this group.  If
374 it is a list, this list will be used as the adaptive scoring rules.
375 If it isn't present, or is something other than `t' or `ignore', the
376 default adaptive scoring rules will be used.  If you want to use
377 adaptive scoring on most groups, you'd set `gnus-use-adaptive-scoring'
378 to `t', and insert an `(adapt ignore)' in the groups where you do not
379 want adaptive scoring.  If you only want adaptive scoring in a few
380 groups, you'd set `gnus-use-adaptive-scoring' to `nil', and insert
381 `(adapt t)' in the score files of the groups where you want it.")
382
383     (adapt-file (file :tag "Adapt-file") "\
384 All adaptive score entries will go to the file named by this entry.
385 It will also be applied when entering the group.  This atom might
386 be handy if you want to adapt on several groups at once, using the
387 same adaptive file for a number of groups.")
388
389     (local (repeat :tag "Local"
390                    (group :value (nil nil)
391                           (symbol :tag "Variable")
392                           (sexp :tag "Value"))) "\
393 The value of this entry should be a list of `(VAR VALUE)' pairs.
394 Each VAR will be made buffer-local to the current summary buffer,
395 and set to the value specified.  This is a convenient, if somewhat
396 strange, way of setting variables in some groups if you don't like
397 hooks much.")
398     (touched (sexp :format "Touched\n") "Internal variable."))
399   "Alist of valid symbolic score parameters.
400
401 Each entry has the form (NAME TYPE DOC), where NAME is the parameter
402 itself (a symbol), TYPE is the parameters type (a sexp widget), and DOC is a
403 documentation string for the parameter.")
404
405 (define-widget 'gnus-score-string 'group
406   "Edit score entries for string-valued headers."
407   :convert-widget 'gnus-score-string-convert)
408
409 (defun gnus-score-string-convert (widget)
410   ;; Set args appropriately.
411   (let* ((tag (widget-get widget :tag))
412          (item `(const :format "" :value ,(downcase tag)))
413          (match '(string :tag "Match"))
414          (score '(choice :tag "Score"
415                         (const :tag "default" nil)
416                         (integer :format "%v"
417                                  :hide-front-space t)))
418          (expire '(choice :tag "Expire"
419                           (const :tag "off" nil)
420                           (integer :format "%v"
421                                    :hide-front-space t)))
422          (type '(choice :tag "Type"
423                         :value s
424                         ;; I should really create a forgiving :match
425                         ;; function for each type below, that only
426                         ;; looked at the first letter.
427                         (const :tag "Regexp" r)
428                         (const :tag "Regexp (fixed case)" R)
429                         (const :tag "Substring" s)
430                         (const :tag "Substring (fixed case)" S)
431                         (const :tag "Exact" e)
432                         (const :tag "Exact (fixed case)" E)
433                         (const :tag "Word" w)
434                         (const :tag "Word (fixed case)" W)
435                         (const :tag "default" nil)))
436          (group `(group ,match ,score ,expire ,type))
437          (doc (concat (or (widget-get widget :doc)
438                           (concat "Change score based on the " tag
439                                   " header.\n"))
440                       "
441 You can have an arbitrary number of score entries for this header,
442 each score entry has four elements:
443
444 1. The \"match element\".  This should be the string to look for in the
445    header.
446
447 2. The \"score element\".  This number should be an integer in the
448    neginf to posinf interval.  This number is added to the score
449    of the article if the match is successful.  If this element is
450    not present, the `gnus-score-interactive-default-score' number
451    will be used instead.  This is 1000 by default.
452
453 3. The \"date element\".  This date says when the last time this score
454    entry matched, which provides a mechanism for expiring the
455    score entries.  It this element is not present, the score
456    entry is permanent.  The date is represented by the number of
457    days since December 31, 1 ce.
458
459 4. The \"type element\".  This element specifies what function should
460    be used to see whether this score entry matches the article.
461
462    There are the regexp, as well as substring types, and exact match,
463    and word match types.  If this element is not present, Gnus will
464    assume that substring matching should be used.  There is case
465    sensitive variants of all match types.")))
466     (widget-put widget :args `(,item
467                                (repeat :inline t
468                                        :indent 0
469                                        :tag ,tag
470                                        :doc ,doc
471                                        :format "%t:\n%h%v%i\n\n"
472                                        (choice :format "%v"
473                                                :value ("" nil nil s)
474                                                ,group
475                                                sexp)))))
476   widget)
477
478 (define-widget 'gnus-score-integer 'group
479   "Edit score entries for integer-valued headers."
480   :convert-widget 'gnus-score-integer-convert)
481
482 (defun gnus-score-integer-convert (widget)
483   ;; Set args appropriately.
484   (let* ((tag (widget-get widget :tag))
485          (item `(const :format "" :value ,(downcase tag)))
486          (match '(integer :tag "Match"))
487          (score '(choice :tag "Score"
488                         (const :tag "default" nil)
489                         (integer :format "%v"
490                                  :hide-front-space t)))
491          (expire '(choice :tag "Expire"
492                           (const :tag "off" nil)
493                           (integer :format "%v"
494                                    :hide-front-space t)))
495          (type '(choice :tag "Type"
496                         :value <
497                         (const <)
498                         (const >)
499                         (const =)
500                         (const >=)
501                         (const <=)))
502          (group `(group ,match ,score ,expire ,type))
503          (doc (concat (or (widget-get widget :doc)
504                           (concat "Change score based on the " tag
505                                   " header.")))))
506     (widget-put widget :args `(,item
507                                (repeat :inline t
508                                        :indent 0
509                                        :tag ,tag
510                                        :doc ,doc
511                                        :format "%t:\n%h%v%i\n\n"
512                                        ,group))))
513   widget)
514
515 (define-widget 'gnus-score-date 'group
516   "Edit score entries for date-valued headers."
517   :convert-widget 'gnus-score-date-convert)
518
519 (defun gnus-score-date-convert (widget)
520   ;; Set args appropriately.
521   (let* ((tag (widget-get widget :tag))
522          (item `(const :format "" :value ,(downcase tag)))
523          (match '(string :tag "Match"))
524          (score '(choice :tag "Score"
525                         (const :tag "default" nil)
526                         (integer :format "%v"
527                                  :hide-front-space t)))
528          (expire '(choice :tag "Expire"
529                           (const :tag "off" nil)
530                           (integer :format "%v"
531                                    :hide-front-space t)))
532          (type '(choice :tag "Type"
533                         :value regexp
534                         (const regexp)
535                         (const before)
536                         (const at)
537                         (const after)))
538          (group `(group ,match ,score ,expire ,type))
539          (doc (concat (or (widget-get widget :doc)
540                           (concat "Change score based on the " tag
541                                   " header."))
542                       "
543 For the Date header we have three kinda silly match types: `before',
544 `at' and `after'.  I can't really imagine this ever being useful, but,
545 like, it would feel kinda silly not to provide this function.  Just in
546 case.  You never know.  Better safe than sorry.  Once burnt, twice
547 shy.  Don't judge a book by its cover.  Never not have sex on a first
548 date.  (I have been told that at least one person, and I quote,
549 \"found this function indispensable\", however.)
550
551 A more useful match type is `regexp'.  With it, you can match the date
552 string using a regular expression.  The date is normalized to ISO8601
553 compact format first---`YYYYMMDDTHHMMSS'.  If you want to match all
554 articles that have been posted on April 1st in every year, you could
555 use `....0401.........' as a match string, for instance.  (Note that
556 the date is kept in its original time zone, so this will match
557 articles that were posted when it was April 1st where the article was
558 posted from.  Time zones are such wholesome fun for the whole family,
559 eh?")))
560     (widget-put widget :args `(,item
561                                (repeat :inline t
562                                        :indent 0
563                                        :tag ,tag
564                                        :doc ,doc
565                                        :format "%t:\n%h%v%i\n\n"
566                                        ,group))))
567   widget)
568
569 (defvar gnus-custom-scores)
570 (defvar gnus-custom-score-alist)
571
572 (defun gnus-score-customize (file)
573   "Customize score file FILE."
574   (interactive (list gnus-current-score-file))
575   (let ((scores (gnus-score-load file))
576         (types (mapcar (lambda (entry)
577                  `(group :format "%v%h\n"
578                          :doc ,(nth 2 entry)
579                          (const :format "" ,(nth 0 entry))
580                          ,(nth 1 entry)))
581                gnus-score-parameters)))
582     ;; Ready.
583     (kill-buffer (gnus-get-buffer-create "*Gnus Customize*"))
584     (switch-to-buffer (gnus-get-buffer-create "*Gnus Customize*"))
585     (gnus-custom-mode)
586     (make-local-variable 'gnus-custom-score-alist)
587     (setq gnus-custom-score-alist scores)
588     (widget-insert "Customize the ")
589     (widget-create 'info-link
590                    :help-echo "Push me to learn more."
591                    :tag "score entries"
592                    "(gnus)Score File Format")
593     (widget-insert " for\n\t")
594     (widget-insert file)
595     (widget-insert "\nand press ")
596     (widget-create 'push-button
597                    :tag "done"
598                    :help-echo "Push me when done customizing."
599                    :action 'gnus-score-customize-done)
600     (widget-insert ".\n
601 Check the [ ] for the entries you want to apply to this score file, then
602 edit the value to suit your taste.  Don't forget to mark the checkbox,
603 if you do all your changes will be lost.  ")
604     (widget-create 'push-button
605                    :action (lambda (&rest ignore)
606                              (require 'gnus-audio)
607                              (gnus-audio-play "Evil_Laugh.au"))
608                    "Bhahahah!")
609     (widget-insert "\n\n")
610     (make-local-variable 'gnus-custom-scores)
611     (setq gnus-custom-scores
612           (widget-create 'group
613                          :value scores
614                          `(checklist :inline t
615                                      :greedy t
616                                      (gnus-score-string :tag "From")
617                                      (gnus-score-string :tag "Subject")
618                                      (gnus-score-string :tag "References")
619                                      (gnus-score-string :tag "Xref")
620                                      (gnus-score-string :tag "Extra")
621                                      (gnus-score-string :tag "Message-ID")
622                                      (gnus-score-integer :tag "Lines")
623                                      (gnus-score-integer :tag "Chars")
624                                      (gnus-score-date :tag "Date")
625                                      (gnus-score-string :tag "Head"
626                                                         :doc "\
627 Match all headers in the article.
628
629 Using one of `Head', `Body', `All' will slow down scoring considerable.
630 ")
631                                      (gnus-score-string :tag "Body"
632                                                         :doc "\
633 Match the body sans header of the article.
634
635 Using one of `Head', `Body', `All' will slow down scoring considerable.
636 ")
637                                      (gnus-score-string :tag "All"
638                                                         :doc "\
639 Match the entire article, including both headers and body.
640
641 Using one of `Head', `Body', `All' will slow down scoring
642 considerable.
643 ")
644                                      (gnus-score-string :tag
645                                                         "Followup"
646                                                         :doc "\
647 Score all followups to the specified authors.
648
649 This entry is somewhat special, in that it will match the `From:'
650 header, and affect the score of not only the matching articles, but
651 also all followups to the matching articles.  This allows you
652 e.g. increase the score of followups to your own articles, or decrease
653 the score of followups to the articles of some known trouble-maker.
654 ")
655                                      (gnus-score-string :tag "Thread"
656                                                         :doc "\
657 Add a score entry on all articles that are part of a thread.
658
659 This match key works along the same lines as the `Followup' match key.
660 If you say that you want to score on a (sub-)thread that is started by
661 an article with a `Message-ID' X, then you add a `thread' match.  This
662 will add a new `thread' match for each article that has X in its
663 `References' header.  (These new `thread' matches will use the
664 `Message-ID's of these matching articles.)  This will ensure that you
665 can raise/lower the score of an entire thread, even though some
666 articles in the thread may not have complete `References' headers.
667 Note that using this may lead to undeterministic scores of the
668 articles in the thread.
669 ")
670                                      ,@types)
671                          '(repeat :inline t
672                                   :tag "Unknown entries"
673                                   sexp)))
674     (use-local-map widget-keymap)
675     (widget-setup)))
676
677 (defun gnus-score-customize-done (&rest ignore)
678   "Reset the score alist with the present value."
679   (let ((alist gnus-custom-score-alist)
680         (value (widget-value gnus-custom-scores)))
681     (setcar alist (car value))
682     (setcdr alist (cdr value))
683     (gnus-score-set 'touched '(t) alist))
684   (bury-buffer))
685
686 ;;; The End:
687
688 (provide 'gnus-cus)
689
690 ;;; gnus-cus.el ends here