projects
/
elisp
/
gnus.git-
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Synch to No Gnus 200502120211.
[elisp/gnus.git-]
/
lisp
/
gnus-registry.el
diff --git
a/lisp/gnus-registry.el
b/lisp/gnus-registry.el
index
bd405c0
..
1daa0fa
100644
(file)
--- a/
lisp/gnus-registry.el
+++ b/
lisp/gnus-registry.el
@@
-1,5
+1,5
@@
;;; gnus-registry.el --- article registry for Gnus
;;; gnus-registry.el --- article registry for Gnus
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
;; Free Software Foundation, Inc.
;; Author: Ted Zlatanov <tzz@lifelogs.com>
;; Free Software Foundation, Inc.
;; Author: Ted Zlatanov <tzz@lifelogs.com>
@@
-66,9
+66,12
@@
(defgroup gnus-registry nil
"The Gnus registry."
(defgroup gnus-registry nil
"The Gnus registry."
+ :version "21.4"
:group 'gnus)
:group 'gnus)
-(defvar gnus-registry-hashtb nil
+(defvar gnus-registry-hashtb (make-hash-table
+ :size 256
+ :test 'equal)
"*The article registry by Message ID.")
(defcustom gnus-registry-unfollowed-groups '("delayed" "drafts" "queue")
"*The article registry by Message ID.")
(defcustom gnus-registry-unfollowed-groups '("delayed" "drafts" "queue")
@@
-131,7
+134,7
@@
way."
"Maximum number of entries in the registry, nil for unlimited."
:group 'gnus-registry
:type '(radio (const :format "Unlimited " nil)
"Maximum number of entries in the registry, nil for unlimited."
:group 'gnus-registry
:type '(radio (const :format "Unlimited " nil)
- (integer :format "Maximum number: %v\n" :size 0)))
+ (integer :format "Maximum number: %v")))
(defun gnus-registry-track-subject-p ()
(memq 'subject gnus-registry-track-extra))
(defun gnus-registry-track-subject-p ()
(memq 'subject gnus-registry-track-extra))
@@
-267,16
+270,16
@@
way."
(defun gnus-registry-trim (alist)
"Trim alist to size, using gnus-registry-max-entries."
(if (null gnus-registry-max-entries)
(defun gnus-registry-trim (alist)
"Trim alist to size, using gnus-registry-max-entries."
(if (null gnus-registry-max-entries)
- alist ; just return the alist
+ alist ; just return the alist
;; else, when given max-entries, trim the alist
(let* ((timehash (make-hash-table
;; else, when given max-entries, trim the alist
(let* ((timehash (make-hash-table
- :size 4096
- :test 'equal))
- (trim-length (- (length alist) gnus-registry-max-entries))
- (trim-length (if (natnump trim-length) trim-length 0)))
+ :size 4096
+ :test 'equal))
+ (trim-length (- (length alist) gnus-registry-max-entries))
+ (trim-length (if (natnump trim-length) trim-length 0)))
(maphash
(lambda (key value)
(maphash
(lambda (key value)
- (puthash key (gnus-registry-fetch-extra key 'mtime) timehash))
+ (puthash key (gnus-registry-fetch-extra key 'mtime) timehash))
gnus-registry-hashtb)
;; we use the return value of this setq, which is the trimmed alist
gnus-registry-hashtb)
;; we use the return value of this setq, which is the trimmed alist
@@
-369,9
+372,10
@@
See the Info node `(gnus)Fancy Mail Splitting' for more details."
nnmail-split-fancy-with-parent-ignore-groups
(list nnmail-split-fancy-with-parent-ignore-groups)))
references res)
nnmail-split-fancy-with-parent-ignore-groups
(list nnmail-split-fancy-with-parent-ignore-groups)))
references res)
- (if refstr
+ ;; the references string must be valid and parse to valid references
+ (if (and refstr (gnus-extract-references refstr))
(progn
(progn
- (setq references (nreverse (gnus-split-references refstr)))
+ (setq references (nreverse (gnus-extract-references refstr)))
(mapcar (lambda (x)
(setq res (or (gnus-registry-fetch-group x) res))
(when (or (gnus-registry-grep-in-list
(mapcar (lambda (x)
(setq res (or (gnus-registry-fetch-group x) res))
(when (or (gnus-registry-grep-in-list
@@
-617,7
+621,9
@@
Returns the first place where the trail finds a group name."
(when gnus-registry-trim-articles-without-groups
(unless (gnus-registry-group-count id)
(gnus-registry-delete-id id)))
(when gnus-registry-trim-articles-without-groups
(unless (gnus-registry-group-count id)
(gnus-registry-delete-id id)))
- (gnus-registry-store-extra-entry id 'mtime (current-time)))))
+ ;; is this ID still in the registry?
+ (when (gethash id gnus-registry-hashtb)
+ (gnus-registry-store-extra-entry id 'mtime (current-time))))))
(defun gnus-registry-delete-id (id)
"Delete a message ID from the registry."
(defun gnus-registry-delete-id (id)
"Delete a message ID from the registry."
@@
-705,6
+711,8
@@
Returns the first place where the trail finds a group name."
(remove-hook 'gnus-summary-prepare-hook 'gnus-registry-register-message-ids))
(remove-hook 'gnus-summary-prepare-hook 'gnus-registry-register-message-ids))
+(add-hook 'gnus-registry-unload-hook 'gnus-registry-unload-hook)
+
(when gnus-registry-install
(gnus-registry-install-hooks)
(gnus-registry-read))
(when gnus-registry-install
(gnus-registry-install-hooks)
(gnus-registry-read))