See ChangeLog for the log entries
[gnus] / lisp / gnus-score.el
index 06d77bc..4e7b0ba 100644 (file)
@@ -1,8 +1,8 @@
 ;;; gnus-score.el --- scoring code for Gnus
-;; Copyright (C) 1995,96 Free Software Foundation, Inc.
+;; Copyright (C) 1995,96,97,98,99 Free Software Foundation, Inc.
 
 ;; Author: Per Abrahamsen <amanda@iesd.auc.dk>
-;;     Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
+;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
 
 ;; This file is part of GNU Emacs.
 
 ;;; Code:
 
+(eval-when-compile (require 'cl))
+
 (require 'gnus)
 (require 'gnus-sum)
 (require 'gnus-range)
+(require 'message)
+(require 'score-mode)
 
 (defcustom gnus-global-score-files nil
   "List of global score files and directories.
@@ -37,13 +41,13 @@ for each score file or each score file directory.  Gnus will decide
 by itself what score files are applicable to which group.
 
 Say you want to use the single score file
-\"/ftp.ifi.uio.no@ftp:/pub/larsi/ding/score/soc.motss.SCORE\" and all
+\"/ftp.gnus.org@ftp:/pub/larsi/ding/score/soc.motss.SCORE\" and all
 score files in the \"/ftp.some-where:/pub/score\" directory.
 
  (setq gnus-global-score-files
-       '(\"/ftp.ifi.uio.no:/pub/larsi/ding/score/soc.motss.SCORE\"
+       '(\"/ftp.gnus.org:/pub/larsi/ding/score/soc.motss.SCORE\"
          \"/ftp.some-where:/pub/score\"))"
-  :group 'gnus-score
+  :group 'gnus-score-files
   :type '(repeat file))
 
 (defcustom gnus-score-file-single-match-alist nil
@@ -58,7 +62,7 @@ use multiple matches, see gnus-score-file-multiple-match-alist).
 
 These score files are loaded in addition to any files returned by
 gnus-score-find-score-files-function (which see)."
-  :group 'gnus-score
+  :group 'gnus-score-files
   :type '(repeat (cons regexp (repeat file))))
 
 (defcustom gnus-score-file-multiple-match-alist nil
@@ -74,17 +78,18 @@ gnus-score-file-single-match-alist).
 
 These score files are loaded in addition to any files returned by
 gnus-score-find-score-files-function (which see)."
-  :group 'gnus-score
+  :group 'gnus-score-files
   :type '(repeat (cons regexp (repeat file))))
 
 (defcustom gnus-score-file-suffix "SCORE"
   "Suffix of the score files."
-  :group 'gnus-score
+  :group 'gnus-score-files
   :type 'string)
 
 (defcustom gnus-adaptive-file-suffix "ADAPT"
   "Suffix of the adaptive score files."
-  :group 'gnus-score
+  :group 'gnus-score-files
+  :group 'gnus-score-adapt
   :type 'string)
 
 (defcustom gnus-score-find-score-files-function 'gnus-score-find-bnews
@@ -103,8 +108,12 @@ See the documentation to these functions for more information.
 
 This variable can also be a list of functions to be called.  Each
 function should either return a list of score files, or a list of
-score alists."
-  :group 'gnus-score
+score alists.
+
+If functions other than these pre-defined functions are used,
+the `a' symbolic prefix to the score commands will always use
+\"all.SCORE\"."
+  :group 'gnus-score-files
   :type '(radio (function-item gnus-score-find-single)
                (function-item gnus-score-find-hierarchical)
                (function-item gnus-score-find-bnews)
@@ -112,13 +121,13 @@ score alists."
 
 (defcustom gnus-score-interactive-default-score 1000
   "*Scoring commands will raise/lower the score with this number as the default."
-  :group 'gnus-score
+  :group 'gnus-score-default
   :type 'integer)
 
 (defcustom gnus-score-expiry-days 7
   "*Number of days before unused score file entries are expired.
 If this variable is nil, no score file entries will be expired."
-  :group 'gnus-score
+  :group 'gnus-score-expire
   :type '(choice (const :tag "never" nil)
                 number))
 
@@ -126,34 +135,35 @@ If this variable is nil, no score file entries will be expired."
   "*In non-nil, update matching score entry dates.
 If this variable is nil, then score entries that provide matches
 will be expired along with non-matching score entries."
-  :group 'gnus-score
+  :group 'gnus-score-expire
   :type 'boolean)
 
 (defcustom gnus-orphan-score nil
   "*All orphans get this score added.  Set in the score file."
-  :group 'gnus-score
-  :type 'integer)
+  :group 'gnus-score-default
+  :type '(choice (const nil)
+                integer))
 
 (defcustom gnus-decay-scores nil
   "*If non-nil, decay non-permanent scores."
-  :group 'gnus-score
+  :group 'gnus-score-decay
   :type 'boolean)
 
 (defcustom gnus-decay-score-function 'gnus-decay-score
   "*Function called to decay a score.
 It is called with one parameter -- the score to be decayed."
-  :group 'gnus-score
+  :group 'gnus-score-decay
   :type '(radio (function-item gnus-decay-score)
                (function :tag "Other")))
 
 (defcustom gnus-score-decay-constant 3
   "*Decay all \"small\" scores with this amount."
-  :group 'gnus-score
+  :group 'gnus-score-decay
   :type 'integer)
 
 (defcustom gnus-score-decay-scale .05
   "*Decay all \"big\" scores with this factor."
-  :group 'gnus-score
+  :group 'gnus-score-decay
   :type 'number)
 
 (defcustom gnus-home-score-file nil
@@ -179,39 +189,40 @@ It can be:
 
    * A function.
      If the function returns non-nil, the result will be used
-     as the home score file.  The function will be passed the 
+     as the home score file.  The function will be passed the
      name of the group as its parameter.
 
    * A string.  Use the string as the home score file.
 
    The list will be traversed from the beginning towards the end looking
    for matches."
-  :group 'gnus-score
+  :group 'gnus-score-files
   :type '(choice string
                 (repeat (choice string
                                 (cons regexp (repeat file))
-                                function))
-                function))
+                                (function :value fun)))
+                (function :value fun)))
 
 (defcustom gnus-home-adapt-file nil
   "Variable to control where new adaptive score entries are to go.
 This variable allows the same syntax as `gnus-home-score-file'."
-  :group 'gnus-score
+  :group 'gnus-score-adapt
+  :group 'gnus-score-files
   :type '(choice string
                 (repeat (choice string
                                 (cons regexp (repeat file))
-                                function))
-                function))
+                                (function :value fun)))
+                (function :value fun)))
 
-(defcustom gnus-default-adaptive-score-alist  
+(defcustom gnus-default-adaptive-score-alist
   '((gnus-kill-file-mark)
     (gnus-unread-mark)
     (gnus-read-mark (from 3) (subject 30))
     (gnus-catchup-mark (subject -10))
     (gnus-killed-mark (from -1) (subject -20))
     (gnus-del-mark (from -2) (subject -15)))
-"Alist of marks and scores."
-:group 'gnus-score
+"*Alist of marks and scores."
+:group 'gnus-score-adapt
 :type '(repeat (cons (symbol :tag "Mark")
                     (repeat (list (choice :tag "Header"
                                           (const from)
@@ -221,7 +232,7 @@ This variable allows the same syntax as `gnus-home-score-file'."
 
 (defcustom gnus-ignored-adaptive-words nil
   "List of words to be ignored when doing adaptive word scoring."
-  :group 'gnus-score
+  :group 'gnus-score-adapt
   :type '(repeat string))
 
 (defcustom gnus-default-ignored-adaptive-words
@@ -239,23 +250,33 @@ This variable allows the same syntax as `gnus-home-score-file'."
     "being" "current" "back" "still" "go" "point" "value" "each" "did"
     "both" "true" "off" "say" "another" "state" "might" "under" "start"
     "try" "re")
-  "Default list of words to be ignored when doing adaptive word scoring."
-  :group 'gnus-score
+  "*Default list of words to be ignored when doing adaptive word scoring."
+  :group 'gnus-score-adapt
   :type '(repeat string))
 
-(defcustom gnus-default-adaptive-word-score-alist  
+(defcustom gnus-default-adaptive-word-score-alist
   `((,gnus-read-mark . 30)
     (,gnus-catchup-mark . -10)
     (,gnus-killed-mark . -20)
     (,gnus-del-mark . -15))
-"Alist of marks and scores."
-:group 'gnus-score
+"*Alist of marks and scores."
+:group 'gnus-score-adapt
 :type '(repeat (cons (character :tag "Mark")
                     (integer :tag "Score"))))
 
+(defcustom gnus-adaptive-word-minimum nil
+  "If a number, this is the minimum score value that can be assigned to a word."
+  :group 'gnus-score-adapt
+  :type '(choice (const nil) integer))
+
+(defcustom gnus-adaptive-word-no-group-words nil
+  "If t, don't adaptively score words included in the group name."
+  :group 'gnus-score-adapt
+  :type 'boolean)
+
 (defcustom gnus-score-mimic-keymap nil
   "*Have the score entry functions pretend that they are a keymap."
-  :group 'gnus-score
+  :group 'gnus-score-default
   :type 'boolean)
 
 (defcustom gnus-score-exact-adapt-limit 10
@@ -266,12 +287,13 @@ for false positives is great, so if the length of the match is less
 than this variable, exact matching will be used.
 
 If this variable is nil, exact matching will always be used."
-  :group 'gnus-score
+  :group 'gnus-score-adapt
   :type '(choice (const nil) integer))
 
 (defcustom gnus-score-uncacheable-files "ADAPT$"
   "All score files that match this regexp will not be cached."
-  :group 'gnus-score
+  :group 'gnus-score-adapt
+  :group 'gnus-score-files
   :type 'regexp)
 
 (defcustom gnus-score-default-header nil
@@ -286,12 +308,13 @@ Should be one of the following symbols.
  i: message-id
  t: references
  x: xref
+ e: `extra' (non-standard overview)
  l: lines
  d: date
  f: followup
 
 If nil, the user will be asked for a header."
-  :group 'gnus-score
+  :group 'gnus-score-default
   :type '(choice (const :tag "from" a)
                 (const :tag "subject" s)
                 (const :tag "body" b)
@@ -299,9 +322,11 @@ If nil, the user will be asked for a header."
                 (const :tag "message-id" i)
                 (const :tag "references" t)
                 (const :tag "xref" x)
+                (const :tag "extra" e)
                 (const :tag "lines" l)
                 (const :tag "date" d)
-                (const :tag "followup" f)))
+                (const :tag "followup" f)
+                (const :tag "ask" nil)))
 
 (defcustom gnus-score-default-type nil
   "Default match type when entering new scores.
@@ -313,28 +338,29 @@ Should be one of the following symbols.
  f: fuzzy string
  r: regexp string
  b: before date
- a: at date
+ a: after date
  n: this date
  <: less than number
  >: greater than number
  =: equal to number
 
 If nil, the user will be asked for a match type."
-  :group 'gnus-score
+  :group 'gnus-score-default
   :type '(choice (const :tag "substring" s)
                 (const :tag "exact string" e)
                 (const :tag "fuzzy string" f)
                 (const :tag "regexp string" r)
                 (const :tag "before date" b)
-                (const :tag "at date" a)
+                (const :tag "after date" a)
                 (const :tag "this date" n)
                 (const :tag "less than number" <)
                 (const :tag "greater than number" >)
-                (const :tag "equal than number" =)))
+                (const :tag "equal than number" =)
+                (const :tag "ask" nil)))
 
 (defcustom gnus-score-default-fold nil
   "Use case folding for new score file entries iff not nil."
-  :group 'gnus-score
+  :group 'gnus-score-default
   :type 'boolean)
 
 (defcustom gnus-score-default-duration nil
@@ -347,16 +373,22 @@ Should be one of the following symbols.
  i: immediate
 
 If nil, the user will be asked for a duration."
-  :group 'gnus-score
+  :group 'gnus-score-default
   :type '(choice (const :tag "temporary" t)
                 (const :tag "permanent" p)
-                (const :tag "immediate" i)))
+                (const :tag "immediate" i)
+                (const :tag "ask" nil)))
 
 (defcustom gnus-score-after-write-file-function nil
   "Function called with the name of the score file just written to disk."
-  :group 'gnus-score
+  :group 'gnus-score-files
   :type 'function)
 
+(defcustom gnus-score-thread-simplify nil
+  "If non-nil, subjects will simplified as in threading."
+  :group 'gnus-score-various
+  :type 'boolean)
+
 \f
 
 ;; Internal variables.
@@ -384,7 +416,7 @@ If nil, the user will be asked for a duration."
 
 (defvar gnus-score-alist nil
   "Alist containing score information.
-The keys can be symbols or strings.  The following symbols are defined. 
+The keys can be symbols or strings.  The following symbols are defined.
 
 touched: If this alist has been modified.
 mark:    Automatically mark articles below this.
@@ -414,6 +446,7 @@ of the last successful match.")
     ("chars" 6 gnus-score-integer)
     ("lines" 7 gnus-score-integer)
     ("xref" 8 gnus-score-string)
+    ("extra" 9 gnus-score-string)
     ("head" -1 gnus-score-body)
     ("body" -1 gnus-score-body)
     ("all" -1 gnus-score-body)
@@ -424,7 +457,6 @@ of the last successful match.")
 
 (gnus-define-keys (gnus-summary-score-map "V" gnus-summary-mode-map)
   "s" gnus-summary-set-score
-  "a" gnus-summary-score-entry
   "S" gnus-summary-current-score
   "c" gnus-score-change-score-file
   "C" gnus-score-customize
@@ -442,13 +474,13 @@ of the last successful match.")
 ;; Much modification of the kill (ahem, score) code and lots of the
 ;; functions are written by Per Abrahamsen <amanda@iesd.auc.dk>.
 
-(defun gnus-summary-lower-score (&optional score)
+(defun gnus-summary-lower-score (&optional score symp)
   "Make a score entry based on the current article.
 The user will be prompted for header to score on, match type,
 permanence, and the string to be used.  The numerical prefix will be
 used as score."
-  (interactive "P")
-  (gnus-summary-increase-score (- (gnus-score-default score))))
+  (interactive (gnus-interactive "P\ny"))
+  (gnus-summary-increase-score (- (gnus-score-default score)) symp))
 
 (defun gnus-score-kill-help-buffer ()
   (when (get-buffer "*Score Help*")
@@ -456,28 +488,28 @@ used as score."
     (when gnus-score-help-winconf
       (set-window-configuration gnus-score-help-winconf))))
 
-(defun gnus-summary-increase-score (&optional score)
+(defun gnus-summary-increase-score (&optional score symp)
   "Make a score entry based on the current article.
 The user will be prompted for header to score on, match type,
 permanence, and the string to be used.  The numerical prefix will be
 used as score."
-  (interactive "P")
-  (gnus-set-global-variables)
+  (interactive (gnus-interactive "P\ny"))
   (let* ((nscore (gnus-score-default score))
         (prefix (if (< nscore 0) ?L ?I))
         (increase (> nscore 0))
-        (char-to-header 
+        (char-to-header
          '((?a "from" nil nil string)
            (?s "subject" nil nil string)
            (?b "body" "" nil body-string)
            (?h "head" "" nil body-string)
-           (?i "message-id" nil t string)
-           (?t "references" "message-id" nil string)
+           (?i "message-id" nil nil string)
+           (?r "references" "message-id" nil string)
            (?x "xref" nil nil string)
+           (?e "extra" nil nil string)
            (?l "lines" nil nil number)
            (?d "date" nil nil date)
            (?f "followup" nil nil string)
-           (?T "thread" nil nil string)))
+           (?t "thread" "message-id" nil string)))
         (char-to-type
          '((?s s "substring" string)
            (?e e "exact string" string)
@@ -486,30 +518,31 @@ used as score."
            (?z s "substring" body-string)
            (?p r "regexp string" body-string)
            (?b before "before date" date)
-           (?a at "at date" date)
-           (?n now "this date" date)
+           (?a after "after date" date)
+           (?n at "this date" date)
            (?< < "less than number" number)
            (?> > "greater than number" number)
            (?= = "equal to number" number)))
+        (current-score-file gnus-current-score-file)
         (char-to-perm
          (list (list ?t (current-time-string) "temporary")
                '(?p perm "permanent") '(?i now "immediate")))
         (mimic gnus-score-mimic-keymap)
-        (hchar (and gnus-score-default-header 
+        (hchar (and gnus-score-default-header
                     (aref (symbol-name gnus-score-default-header) 0)))
         (tchar (and gnus-score-default-type
                     (aref (symbol-name gnus-score-default-type) 0)))
         (pchar (and gnus-score-default-duration
                     (aref (symbol-name gnus-score-default-duration) 0)))
-        entry temporary type match)
-    
+        entry temporary type match extra)
+
     (unwind-protect
        (progn
 
          ;; First we read the header to score.
          (while (not hchar)
            (if mimic
-               (progn 
+               (progn
                  (sit-for 1)
                  (message "%c-" prefix))
              (message "%s header (%s?): " (if increase "Increase" "Lower")
@@ -522,50 +555,47 @@ used as score."
 
          (gnus-score-kill-help-buffer)
          (unless (setq entry (assq (downcase hchar) char-to-header))
-           (if mimic (error "%c %c" prefix hchar) (error "")))
+           (if mimic (error "%c %c" prefix hchar)
+             (error "Invalid header type")))
 
          (when (/= (downcase hchar) hchar)
            ;; This was a majuscule, so we end reading and set the defaults.
            (if mimic (message "%c %c" prefix hchar) (message ""))
            (setq tchar (or tchar ?s)
                  pchar (or pchar ?t)))
-    
-         ;; We continue reading - the type.
-         (while (not tchar)
-           (if mimic
-               (progn
-                 (sit-for 1) (message "%c %c-" prefix hchar))
-             (message "%s header '%s' with match type (%s?): "
-                      (if increase "Increase" "Lower")
-                      (nth 1 entry)
-                      (mapconcat (lambda (s)
-                                   (if (eq (nth 4 entry)
-                                           (nth 3 s))
-                                       (char-to-string (car s))
-                                     ""))
-                                 char-to-type "")))
-           (setq tchar (read-char))
-           (when (or (= tchar ??) (= tchar ?\C-h))
-             (setq tchar nil)
-             (gnus-score-insert-help
-              "Match type"
-              (delq nil
-                    (mapcar (lambda (s)
-                              (if (eq (nth 4 entry)
-                                      (nth 3 s))
-                                  s nil))
-                            char-to-type))
-              2)))
 
-         (gnus-score-kill-help-buffer)
-         (unless (setq type (nth 1 (assq (downcase tchar) char-to-type)))
-           (if mimic (error "%c %c" prefix hchar) (error "")))
+         (let ((legal-types
+                (delq nil
+                      (mapcar (lambda (s)
+                                (if (eq (nth 4 entry)
+                                        (nth 3 s))
+                                    s nil))
+                              char-to-type))))
+           ;; We continue reading - the type.
+           (while (not tchar)
+             (if mimic
+                 (progn
+                   (sit-for 1) (message "%c %c-" prefix hchar))
+               (message "%s header '%s' with match type (%s?): "
+                        (if increase "Increase" "Lower")
+                        (nth 1 entry)
+                        (mapconcat (lambda (s) (char-to-string (car s)))
+                                   legal-types "")))
+             (setq tchar (read-char))
+             (when (or (= tchar ??) (= tchar ?\C-h))
+               (setq tchar nil)
+               (gnus-score-insert-help "Match type" legal-types 2)))
+
+           (gnus-score-kill-help-buffer)
+           (unless (setq type (nth 1 (assq (downcase tchar) legal-types)))
+             (if mimic (error "%c %c" prefix hchar)
+               (error "Invalid match type"))))
 
          (when (/= (downcase tchar) tchar)
            ;; It was a majuscule, so we end reading and use the default.
            (if mimic (message "%c %c %c" prefix hchar tchar)
              (message ""))
-           (setq pchar (or pchar ?p)))
+           (setq pchar (or pchar ?t)))
 
          ;; We continue reading.
          (while (not pchar)
@@ -590,27 +620,59 @@ used as score."
                       (eq tchar 114)
                       (eq (- pchar 4) 111))
              (error "You rang?"))
-           (if mimic 
+           (if mimic
                (error "%c %c %c %c" prefix hchar tchar pchar)
-             (error ""))))
+             (error "Invalid match duration"))))
       ;; Always kill the score help buffer.
       (gnus-score-kill-help-buffer))
 
+    ;; If scoring an extra (non-standard overview) header,
+    ;; we must find out which header is in question.
+    (setq extra
+         (and gnus-extra-headers
+              (equal (nth 1 entry) "extra")
+              (intern                  ; need symbol
+               (gnus-completing-read
+                (symbol-name (car gnus-extra-headers)) ; default response
+                "Score extra header:"  ; prompt
+                (mapcar (lambda (x)    ; completion list
+                          (cons (symbol-name x) x))
+                        gnus-extra-headers)
+                nil                    ; no completion limit
+                t))))                  ; require match
+    ;; extra is now nil or a symbol.
+
     ;; We have all the data, so we enter this score.
     (setq match (if (string= (nth 2 entry) "") ""
-                 (gnus-summary-header (or (nth 2 entry) (nth 1 entry)))))
-      
+                 (gnus-summary-header (or (nth 2 entry) (nth 1 entry))
+                                      nil extra)))
+
     ;; Modify the match, perhaps.
-    (cond 
+    (cond
      ((equal (nth 1 entry) "xref")
       (when (string-match "^Xref: *" match)
        (setq match (substring match (match-end 0))))
       (when (string-match "^[^:]* +" match)
        (setq match (substring match (match-end 0))))))
-    
+
     (when (memq type '(r R regexp Regexp))
       (setq match (regexp-quote match)))
 
+    ;; Change score file to the "all.SCORE" file.
+    (when (eq symp 'a)
+      (save-excursion
+       (set-buffer gnus-summary-buffer)
+       (gnus-score-load-file
+        ;; This is a kludge; yes...
+        (cond
+         ((eq gnus-score-find-score-files-function
+              'gnus-score-find-hierarchical)
+          (gnus-score-file-name ""))
+         ((eq gnus-score-find-score-files-function 'gnus-score-find-single)
+          current-score-file)
+         (t
+          (gnus-score-file-name "all"))))))
+
     (gnus-summary-score-entry
      (nth 1 entry)                     ; Header
      match                             ; Match
@@ -619,14 +681,21 @@ used as score."
      (if (eq temporary 'perm)          ; Temp
         nil
        temporary)
-     (not (nth 3 entry)))              ; Prompt
-    ))
-  
+     (not (nth 3 entry))               ; Prompt
+     nil                               ; not silent
+     extra)                            ; non-standard overview.
+
+    (when (eq symp 'a)
+      ;; We change the score file back to the previous one.
+      (save-excursion
+       (set-buffer gnus-summary-buffer)
+       (gnus-score-load-file current-score-file)))))
+
 (defun gnus-score-insert-help (string alist idx)
   (setq gnus-score-help-winconf (current-window-configuration))
   (save-excursion
-    (set-buffer (get-buffer-create "*Score Help*"))
-    (buffer-disable-undo (current-buffer))
+    (set-buffer (gnus-get-buffer-create "*Score Help*"))
+    (buffer-disable-undo)
     (delete-windows-on (current-buffer))
     (erase-buffer)
     (insert string ":\n\n")
@@ -643,7 +712,7 @@ used as score."
       (setq max (+ max 4))             ; %c, `:', SPACE, a SPACE at end
       (setq n (/ (1- (window-width)) max)) ; items per line
       (setq width (/ (1- (window-width)) n)) ; width of each item
-      ;; insert `n' items, each in a field of width `width' 
+      ;; insert `n' items, each in a field of width `width'
       (while alist
        (if (< i n)
            ()
@@ -662,15 +731,17 @@ used as score."
     (let ((window-min-height 1))
       (shrink-window-if-larger-than-buffer))
     (select-window (get-buffer-window gnus-summary-buffer))))
-  
-(defun gnus-summary-header (header &optional no-err)
+
+(defun gnus-summary-header (header &optional no-err extra)
   ;; Return HEADER for current articles, or error.
   (let ((article (gnus-summary-article-number))
        headers)
     (if article
        (if (and (setq headers (gnus-summary-article-header article))
                 (vectorp headers))
-           (aref headers (nth 1 (assoc header gnus-header-index)))
+           (if extra                   ; `header' must be "extra"
+               (or (cdr (assq extra (mail-header-extra headers))) "")
+             (aref headers (nth 1 (assoc header gnus-header-index))))
          (if no-err
              nil
            (error "Pseudo-articles can't be scored")))
@@ -680,7 +751,7 @@ used as score."
 
 (defun gnus-newsgroup-score-alist ()
   (or
-   (let ((param-file (gnus-group-find-parameter 
+   (let ((param-file (gnus-group-find-parameter
                      gnus-newsgroup-name 'score-file)))
      (when param-file
        (gnus-score-load param-file)))
@@ -690,13 +761,13 @@ used as score."
 
 (defsubst gnus-score-get (symbol &optional alist)
   ;; Get SYMBOL's definition in ALIST.
-  (cdr (assoc symbol 
-             (or alist 
+  (cdr (assoc symbol
+             (or alist
                  gnus-score-alist
                  (gnus-newsgroup-score-alist)))))
 
 (defun gnus-summary-score-entry (header match type score date