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