*** 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 a
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 (string :tag "Charset") "\
171 The default charset to use in the group."))
172   "Alist of valid group parameters.
173
174 Each entry has the form (NAME TYPE DOC), where NAME is the parameter
175 itself (a symbol), TYPE is the parameters type (a sexp widget), and
176 DOC is a documentation string for the parameter.")
177
178 (defvar gnus-custom-params)
179 (defvar gnus-custom-method)
180 (defvar gnus-custom-group)
181 (defvar gnus-custom-topic)
182
183 (defun gnus-group-customize (group &optional topic)
184   "Edit the group or topic on the current line."
185   (interactive (list (gnus-group-group-name) (gnus-group-topic-name)))
186   (let (info
187         (types (mapcar (lambda (entry)
188                          `(cons :format "%v%h\n"
189                                 :doc ,(nth 2 entry)
190                                 (const :format "" ,(nth 0 entry))
191                                 ,(nth 1 entry)))
192                        gnus-group-parameters)))
193     (unless (or group topic)
194       (error "No group on current line"))
195     (when (and group topic)
196       (error "Both a group an topic on current line"))
197     (unless (or topic (setq info (gnus-get-info group)))
198       (error "Killed group; can't be edited"))
199     ;; Ready.
200     (kill-buffer (gnus-get-buffer-create "*Gnus Customize*"))
201     (switch-to-buffer (gnus-get-buffer-create "*Gnus Customize*"))
202     (gnus-custom-mode)
203     (make-local-variable 'gnus-custom-group)
204     (setq gnus-custom-group group)
205     (make-local-variable 'gnus-custom-topic)
206     (setq gnus-custom-topic topic)
207     (widget-insert "Customize the ")
208     (if group
209         (widget-create 'info-link
210                        :help-echo "Push me to learn more."
211                        :tag "group parameters"
212                        "(gnus)Group Parameters")
213       (widget-create 'info-link
214                      :help-echo "Push me to learn more."
215                      :tag  "topic parameters"
216                      "(gnus)Topic Parameters"))
217     (widget-insert " for <")
218     (widget-insert (or group topic))
219     (widget-insert "> and press ")
220     (widget-create 'push-button
221                    :tag "done"
222                    :help-echo "Push me when done customizing."
223                    :action 'gnus-group-customize-done)
224     (widget-insert ".\n\n")
225     (make-local-variable 'gnus-custom-params)
226     (setq gnus-custom-params
227           (widget-create 'group
228                          :value (if group
229                                     (gnus-info-params info)
230                                   (gnus-topic-parameters topic))
231                          `(set :inline t
232                                :greedy t
233                                :tag "Parameters"
234                                :format "%t:\n%h%v"
235                                :doc "\
236 These special paramerters are recognized by Gnus.
237 Check the [ ] for the parameters you want to apply to this group or
238 to the groups in this topic, then edit the value to suit your taste."
239                                ,@types)
240                          '(repeat :inline t
241                                   :tag "Variables"
242                                   :format "%t:\n%h%v%i\n\n"
243                                   :doc "\
244 Set variables local to the group you are entering.
245
246 If you want to turn threading off in `news.answers', you could put
247 `(gnus-show-threads nil)' in the group parameters of that group.
248 `gnus-show-threads' will be made into a local variable in the summary
249 buffer you enter, and the form `nil' will be `eval'ed there.
250
251 This can also be used as a group-specific hook function, if you'd
252 like.  If you want to hear a beep when you enter a group, you could
253 put something like `(dummy-variable (ding))' in the parameters of that
254 group.  `dummy-variable' will be set to the result of the `(ding)'
255 form, but who cares?"
256                                   (cons :format "%v" :value (nil .  nil)
257                                          (symbol :tag "Variable")
258                                          (sexp :tag
259                                                "Value")))
260
261                          '(repeat :inline t
262                                   :tag "Unknown entries"
263                                   sexp)))
264     (when group
265       (widget-insert "\n\nYou can also edit the ")
266       (widget-create 'info-link
267                      :tag "select method"
268                      :help-echo "Push me to learn more about select methods."
269                      "(gnus)Select Methods")
270       (widget-insert " for the group.\n")
271       (setq gnus-custom-method
272             (widget-create 'sexp
273                            :tag "Method"
274                            :value (gnus-info-method info))))
275     (use-local-map widget-keymap)
276     (widget-setup)))
277
278 (defun gnus-group-customize-done (&rest ignore)
279   "Apply changes and bury the buffer."
280   (interactive)
281   (if gnus-custom-topic
282       (gnus-topic-set-parameters gnus-custom-topic
283                                  (widget-value gnus-custom-params))
284     (gnus-group-edit-group-done 'params gnus-custom-group
285                                 (widget-value gnus-custom-params))
286     (gnus-group-edit-group-done 'method gnus-custom-group
287                                 (widget-value gnus-custom-method)))
288   (bury-buffer))
289
290 ;;; Score Customization:
291
292 (defconst gnus-score-parameters
293   '((mark (number :tag "Mark") "\
294 The value of this entry should be a number.
295 Any articles with a score lower than this number will be marked as read.")
296
297     (expunge (number :tag "Expunge") "\
298 The value of this entry should be a number.
299 Any articles with a score lower than this number will be removed from
300 the summary buffer.")
301
302     (mark-and-expunge (number :tag "Mark-and-expunge") "\
303 The value of this entry should be a number.
304 Any articles with a score lower than this number will be marked as
305 read and removed from the summary buffer.")
306
307     (thread-mark-and-expunge (number :tag "Thread-mark-and-expunge") "\
308 The value of this entry should be a number.
309 All articles that belong to a thread that has a total score below this
310 number will be marked as read and removed from the summary buffer.
311 `gnus-thread-score-function' says how to compute the total score
312 for a thread.")
313
314     (files (repeat :inline t :tag "Files" file) "\
315 The value of this entry should be any number of file names.
316 These files are assumed to be score files as well, and will be loaded
317 the same way this one was.")
318
319     (exclude-files (repeat :inline t :tag "Exclude-files" file) "\
320 The clue of this entry should be any number of files.
321 These files will not be loaded, even though they would normally be so,
322 for some reason or other.")
323
324     (eval (sexp :tag "Eval" :value nil) "\
325 The value of this entry will be `eval'el.
326 This element will be ignored when handling global score files.")
327
328     (read-only (boolean :tag "Read-only" :value t) "\
329 Read-only score files will not be updated or saved.
330 Global score files should feature this atom.")
331
332     (orphan (number :tag "Orphan") "\
333 The value of this entry should be a number.
334 Articles that do not have parents will get this number added to their
335 scores.  Imagine you follow some high-volume newsgroup, like
336 `comp.lang.c'.  Most likely you will only follow a few of the threads,
337 also want to see any new threads.
338
339 You can do this with the following two score file entries:
340
341      (orphan -500)
342      (mark-and-expunge -100)
343
344 When you enter the group the first time, you will only see the new
345 threads.  You then raise the score of the threads that you find
346 interesting (with `I T' or `I S'), and ignore (`C y') the rest.
347 Next time you enter the group, you will see new articles in the
348 interesting threads, plus any new threads.
349
350 I.e.---the orphan score atom is for high-volume groups where there
351 exist a few interesting threads which can't be found automatically
352 by ordinary scoring rules.")
353
354     (adapt (choice :tag "Adapt"
355                    (const t)
356                    (const ignore)
357                    (sexp :format "%v"
358                          :hide-front-space t)) "\
359 This entry controls the adaptive scoring.
360 If it is `t', the default adaptive scoring rules will be used.  If it
361 is `ignore', no adaptive scoring will be performed on this group.  If
362 it is a list, this list will be used as the adaptive scoring rules.
363 If it isn't present, or is something other than `t' or `ignore', the
364 default adaptive scoring rules will be used.  If you want to use
365 adaptive scoring on most groups, you'd set `gnus-use-adaptive-scoring'
366 to `t', and insert an `(adapt ignore)' in the groups where you do not
367 want adaptive scoring.  If you only want adaptive scoring in a few
368 groups, you'd set `gnus-use-adaptive-scoring' to `nil', and insert
369 `(adapt t)' in the score files of the groups where you want it.")
370
371     (adapt-file (file :tag "Adapt-file") "\
372 All adaptive score entries will go to the file named by this entry.
373 It will also be applied when entering the group.  This atom might
374 be handy if you want to adapt on several groups at once, using the
375 same adaptive file for a number of groups.")
376
377     (local (repeat :tag "Local"
378                    (group :value (nil nil)
379                           (symbol :tag "Variable")
380                           (sexp :tag "Value"))) "\
381 The value of this entry should be a list of `(VAR VALUE)' pairs.
382 Each VAR will be made buffer-local to the current summary buffer,
383 and set to the value specified.  This is a convenient, if somewhat
384 strange, way of setting variables in some groups if you don't like
385 hooks much.")
386     (touched (sexp :format "Touched\n") "Internal variable."))
387   "Alist of valid symbolic score parameters.
388
389 Each entry has the form (NAME TYPE DOC), where NAME is the parameter
390 itself (a symbol), TYPE is the parameters type (a sexp widget), and DOC is a
391 documentation string for the parameter.")
392
393 (define-widget 'gnus-score-string 'group
394   "Edit score entries for string-valued headers."
395   :convert-widget 'gnus-score-string-convert)
396
397 (defun gnus-score-string-convert (widget)
398   ;; Set args appropriately.
399   (let* ((tag (widget-get widget :tag))
400          (item `(const :format "" :value ,(downcase tag)))
401          (match '(string :tag "Match"))
402          (score '(choice :tag "Score"
403                         (const :tag "default" nil)
404                         (integer :format "%v"
405                                  :hide-front-space t)))
406          (expire '(choice :tag "Expire"
407                           (const :tag "off" nil)
408                           (integer :format "%v"
409                                    :hide-front-space t)))
410          (type '(choice :tag "Type"
411                         :value s
412                         ;; I should really create a forgiving :match
413                         ;; function for each type below, that only
414                         ;; looked at the first letter.
415                         (const :tag "Regexp" r)
416                         (const :tag "Regexp (fixed case)" R)
417                         (const :tag "Substring" s)
418                         (const :tag "Substring (fixed case)" S)
419                         (const :tag "Exact" e)
420                         (const :tag "Exact (fixed case)" E)
421                         (const :tag "Word" w)
422                         (const :tag "Word (fixed case)" W)
423                         (const :tag "default" nil)))
424          (group `(group ,match ,score ,expire ,type))
425          (doc (concat (or (widget-get widget :doc)
426                           (concat "Change score based on the " tag
427                                   " header.\n"))
428                       "
429 You can have an arbitrary number of score entries for this header,
430 each score entry has four elements:
431
432 1. The \"match element\".  This should be the string to look for in the
433    header.
434
435 2. The \"score element\".  This number should be an integer in the
436    neginf to posinf interval.  This number is added to the score
437    of the article if the match is successful.  If this element is
438    not present, the `gnus-score-interactive-default-score' number
439    will be used instead.  This is 1000 by default.
440
441 3. The \"date element\".  This date says when the last time this score
442    entry matched, which provides a mechanism for expiring the
443    score entries.  It this element is not present, the score
444    entry is permanent.  The date is represented by the number of
445    days since December 31, 1 ce.
446
447 4. The \"type element\".  This element specifies what function should
448    be used to see whether this score entry matches the article.
449
450    There are the regexp, as well as substring types, and exact match,
451    and word match types.  If this element is not present, Gnus will
452    assume that substring matching should be used.  There is case
453    sensitive variants of all match types.")))
454     (widget-put widget :args `(,item
455                                (repeat :inline t
456                                        :indent 0
457                                        :tag ,tag
458                                        :doc ,doc
459                                        :format "%t:\n%h%v%i\n\n"
460                                        (choice :format "%v"
461                                                :value ("" nil nil s)
462                                                ,group
463                                                sexp)))))
464   widget)
465
466 (define-widget 'gnus-score-integer 'group
467   "Edit score entries for integer-valued headers."
468   :convert-widget 'gnus-score-integer-convert)
469
470 (defun gnus-score-integer-convert (widget)
471   ;; Set args appropriately.
472   (let* ((tag (widget-get widget :tag))
473          (item `(const :format "" :value ,(downcase tag)))
474          (match '(integer :tag "Match"))
475          (score '(choice :tag "Score"
476                         (const :tag "default" nil)
477                         (integer :format "%v"
478                                  :hide-front-space t)))
479          (expire '(choice :tag "Expire"
480                           (const :tag "off" nil)
481                           (integer :format "%v"
482                                    :hide-front-space t)))
483          (type '(choice :tag "Type"
484                         :value <
485                         (const <)
486                         (const >)
487                         (const =)
488                         (const >=)
489                         (const <=)))
490          (group `(group ,match ,score ,expire ,type))
491          (doc (concat (or (widget-get widget :doc)
492                           (concat "Change score based on the " tag
493                                   " header.")))))
494     (widget-put widget :args `(,item
495                                (repeat :inline t
496                                        :indent 0
497                                        :tag ,tag
498                                        :doc ,doc
499                                        :format "%t:\n%h%v%i\n\n"
500                                        ,group))))
501   widget)
502
503 (define-widget 'gnus-score-date 'group
504   "Edit score entries for date-valued headers."
505   :convert-widget 'gnus-score-date-convert)
506
507 (defun gnus-score-date-convert (widget)
508   ;; Set args appropriately.
509   (let* ((tag (widget-get widget :tag))
510          (item `(const :format "" :value ,(downcase tag)))
511          (match '(string :tag "Match"))
512          (score '(choice :tag "Score"
513                         (const :tag "default" nil)
514                         (integer :format "%v"
515                                  :hide-front-space t)))
516          (expire '(choice :tag "Expire"
517                           (const :tag "off" nil)
518                           (integer :format "%v"
519                                    :hide-front-space t)))
520          (type '(choice :tag "Type"
521                         :value regexp
522                         (const regexp)
523                         (const before)
524                         (const at)
525                         (const after)))
526          (group `(group ,match ,score ,expire ,type))
527          (doc (concat (or (widget-get widget :doc)
528                           (concat "Change score based on the " tag
529                                   " header."))
530                       "
531 For the Date header we have three kinda silly match types: `before',
532 `at' and `after'.  I can't really imagine this ever being useful, but,
533 like, it would feel kinda silly not to provide this function.  Just in
534 case.  You never know.  Better safe than sorry.  Once burnt, twice
535 shy.  Don't judge a book by its cover.  Never not have sex on a first
536 date.  (I have been told that at least one person, and I quote,
537 \"found this function indispensable\", however.)
538
539 A more useful match type is `regexp'.  With it, you can match the date
540 string using a regular expression.  The date is normalized to ISO8601
541 compact format first---`YYYYMMDDTHHMMSS'.  If you want to match all
542 articles that have been posted on April 1st in every year, you could
543 use `....0401.........' as a match string, for instance.  (Note that
544 the date is kept in its original time zone, so this will match
545 articles that were posted when it was April 1st where the article was
546 posted from.  Time zones are such wholesome fun for the whole family,
547 eh?")))
548     (widget-put widget :args `(,item
549                                (repeat :inline t
550                                        :indent 0
551                                        :tag ,tag
552                                        :doc ,doc
553                                        :format "%t:\n%h%v%i\n\n"
554                                        ,group))))
555   widget)
556
557 (defvar gnus-custom-scores)
558 (defvar gnus-custom-score-alist)
559
560 (defun gnus-score-customize (file)
561   "Customize score file FILE."
562   (interactive (list gnus-current-score-file))
563   (let ((scores (gnus-score-load file))
564         (types (mapcar (lambda (entry)
565                  `(group :format "%v%h\n"
566                          :doc ,(nth 2 entry)
567                          (const :format "" ,(nth 0 entry))
568                          ,(nth 1 entry)))
569                gnus-score-parameters)))
570     ;; Ready.
571     (kill-buffer (gnus-get-buffer-create "*Gnus Customize*"))
572     (switch-to-buffer (gnus-get-buffer-create "*Gnus Customize*"))
573     (gnus-custom-mode)
574     (make-local-variable 'gnus-custom-score-alist)
575     (setq gnus-custom-score-alist scores)
576     (widget-insert "Customize the ")
577     (widget-create 'info-link
578                    :help-echo "Push me to learn more."
579                    :tag "score entries"
580                    "(gnus)Score File Format")
581     (widget-insert " for\n\t")
582     (widget-insert file)
583     (widget-insert "\nand press ")
584     (widget-create 'push-button
585                    :tag "done"
586                    :help-echo "Push me when done customizing."
587                    :action 'gnus-score-customize-done)
588     (widget-insert ".\n
589 Check the [ ] for the entries you want to apply to this score file, then
590 edit the value to suit your taste.  Don't forget to mark the checkbox,
591 if you do all your changes will be lost.  ")
592     (widget-create 'push-button
593                    :action (lambda (&rest ignore)
594                              (require 'gnus-audio)
595                              (gnus-audio-play "Evil_Laugh.au"))
596                    "Bhahahah!")
597     (widget-insert "\n\n")
598     (make-local-variable 'gnus-custom-scores)
599     (setq gnus-custom-scores
600           (widget-create 'group
601                          :value scores
602                          `(checklist :inline t
603                                      :greedy t
604                                      (gnus-score-string :tag "From")
605                                      (gnus-score-string :tag "Subject")
606                                      (gnus-score-string :tag "References")
607                                      (gnus-score-string :tag "Xref")
608                                      (gnus-score-string :tag "Extra")
609                                      (gnus-score-string :tag "Message-ID")
610                                      (gnus-score-integer :tag "Lines")
611                                      (gnus-score-integer :tag "Chars")
612                                      (gnus-score-date :tag "Date")
613                                      (gnus-score-string :tag "Head"
614                                                         :doc "\
615 Match all headers in the article.
616
617 Using one of `Head', `Body', `All' will slow down scoring considerable.
618 ")
619                                      (gnus-score-string :tag "Body"
620                                                         :doc "\
621 Match the body sans header of the article.
622
623 Using one of `Head', `Body', `All' will slow down scoring considerable.
624 ")
625                                      (gnus-score-string :tag "All"
626                                                         :doc "\
627 Match the entire article, including both headers and body.
628
629 Using one of `Head', `Body', `All' will slow down scoring
630 considerable.
631 ")
632                                      (gnus-score-string :tag
633                                                         "Followup"
634                                                         :doc "\
635 Score all followups to the specified authors.
636
637 This entry is somewhat special, in that it will match the `From:'
638 header, and affect the score of not only the matching articles, but
639 also all followups to the matching articles.  This allows you
640 e.g. increase the score of followups to your own articles, or decrease
641 the score of followups to the articles of some known trouble-maker.
642 ")
643                                      (gnus-score-string :tag "Thread"
644                                                         :doc "\
645 Add a score entry on all articles that are part of a thread.
646
647 This match key works along the same lines as the `Followup' match key.
648 If you say that you want to score on a (sub-)thread that is started by
649 an article with a `Message-ID' X, then you add a `thread' match.  This
650 will add a new `thread' match for each article that has X in its
651 `References' header.  (These new `thread' matches will use the
652 `Message-ID's of these matching articles.)  This will ensure that you
653 can raise/lower the score of an entire thread, even though some
654 articles in the thread may not have complete `References' headers.
655 Note that using this may lead to undeterministic scores of the
656 articles in the thread.
657 ")
658                                      ,@types)
659                          '(repeat :inline t
660                                   :tag "Unknown entries"
661                                   sexp)))
662     (use-local-map widget-keymap)
663     (widget-setup)))
664
665 (defun gnus-score-customize-done (&rest ignore)
666   "Reset the score alist with the present value."
667   (let ((alist gnus-custom-score-alist)
668         (value (widget-value gnus-custom-scores)))
669     (setcar alist (car value))
670     (setcdr alist (cdr value))
671     (gnus-score-set 'touched '(t) alist))
672   (bury-buffer))
673
674 ;;; The End:
675
676 (provide 'gnus-cus)
677
678 ;;; gnus-cus.el ends here