Delete temporary files when Gnus exits instead of using timers
[gnus] / lisp / gnus-score.el
index f7a507f..5f91246 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gnus-score.el --- scoring code for Gnus
 
-;; Copyright (C) 1995-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2013 Free Software Foundation, Inc.
 
 ;; Author: Per Abrahamsen <amanda@iesd.auc.dk>
 ;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -1071,10 +1071,15 @@ EXTRA is the possible non-standard header."
        (push (cons article n) gnus-newsgroup-scored)))
     (gnus-summary-update-line)))
 
-(defun gnus-summary-current-score ()
-  "Return the score of the current article."
-  (interactive)
-  (gnus-message 1 "%s" (gnus-summary-article-score)))
+(defun gnus-summary-current-score (arg)
+  "Return the score of the current article.
+  With prefix ARG, return the total score of the current (sub)thread."
+  (interactive "P")
+  (gnus-message 1 "%s" (if arg
+                          (gnus-thread-total-score
+                           (gnus-id-to-thread
+                            (mail-header-id (gnus-summary-article-header))))
+                          (gnus-summary-article-score))))
 
 (defun gnus-score-change-score-file (file)
   "Change current score alist."
@@ -1723,7 +1728,8 @@ score in `gnus-newsgroup-scored' by SCORE."
       ((mm-text-parts
        (handle)
        (cond ((stringp (car handle))
-              (let ((parts (mapcan #'mm-text-parts (cdr handle))))
+              (let ((parts (apply #'append
+                                  (mapcar #'mm-text-parts (cdr handle)))))
                 (if (equal "multipart/alternative" (car handle))
                     ;; pick the first supported alternative
                     (list (car parts))
@@ -1733,7 +1739,7 @@ score in `gnus-newsgroup-scored' by SCORE."
               (when (string-match "^text/" (mm-handle-media-type handle))
                 (list handle)))
 
-             (t (mapcan #'mm-text-parts handle))))
+             (t (apply #'append (mapcar #'mm-text-parts handle)))))
        (my-mm-display-part
        (handle)
        (when handle