X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-registry.el;h=c3c8bdf6f975b0aa4bf0253336bd8848ea2898c0;hb=50fa79d1f27db20c812d6da2f982e1fb7834805c;hp=c5faf844b6b47c01b6c12e6c87f10ceaaa125097;hpb=eb258b1e2a4c550a1177b920fdee7f3051fa8bed;p=gnus diff --git a/lisp/gnus-registry.el b/lisp/gnus-registry.el index c5faf844b..c3c8bdf6f 100644 --- a/lisp/gnus-registry.el +++ b/lisp/gnus-registry.el @@ -1,7 +1,7 @@ ;;; gnus-registry.el --- article registry for Gnus ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007 Free Software Foundation, Inc. +;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ;; Author: Ted Zlatanov ;; Keywords: news @@ -334,7 +334,6 @@ considered precious) will not be trimmed." (defun gnus-registry-trim (alist) "Trim alist to size, using gnus-registry-max-entries. -Also, drop all gnus-registry-ignored-groups matches. Any entries with extra data (marks, currently) are left alone." (if (null gnus-registry-max-entries) alist ; just return the alist @@ -353,29 +352,30 @@ Any entries with extra data (marks, currently) are left alone." (let ((extra (gnus-registry-fetch-extra key))) (dolist (item gnus-registry-extra-entries-precious) (dolist (e extra) - (when (eq (nth 0 e) item) + (when (equal (nth 0 e) item) (puthash key t precious) (return)))) (puthash key (gnus-registry-fetch-extra key 'mtime) timehash))) gnus-registry-hashtb) (dolist (item alist) - (let ((key (nth 0 item))) + (let ((key (nth 0 item))) (if (gethash key precious) (push item precious-list) (push item junk-list)))) - + + (sort + junk-list + (lambda (a b) + (let ((t1 (or (cdr (gethash (car a) timehash)) + '(0 0 0))) + (t2 (or (cdr (gethash (car b) timehash)) + '(0 0 0)))) + (time-less-p t1 t2)))) + ;; we use the return value of this setq, which is the trimmed alist - (setq alist - (concat - precious-list - (nthcdr - trim-length - (sort junk-list - (lambda (a b) - (time-less-p - (or (cdr (gethash (car a) timehash)) '(0 0 0)) - (or (cdr (gethash (car b) timehash)) '(0 0 0))))))))))) + (setq alist (append precious-list + (nthcdr trim-length junk-list)))))) (defun gnus-registry-action (action data-header from &optional to method) (let* ((id (mail-header-id data-header)) @@ -577,11 +577,11 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." (unless (gnus-parameter-registry-ignore gnus-newsgroup-name) (dolist (article gnus-newsgroup-articles) (let ((id (gnus-registry-fetch-message-id-fast article))) - (unless (gnus-registry-fetch-group id) + (unless (member gnus-newsgroup-name (gnus-registry-fetch-group id)) (gnus-message 9 "Registry: Registering article %d with group %s" article gnus-newsgroup-name) - (gnus-registry-add-group - (gnus-registry-fetch-message-id-fast article) + (gnus-registry-add-group + id gnus-newsgroup-name (gnus-registry-fetch-simplified-message-subject-fast article) (gnus-registry-fetch-sender-fast article)))))))