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