X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fregistry.el;h=5a35e1f0e8d1ba697e0b93defa29fe15b79c7a38;hb=051d74319415a8e395c9985eb8cac587a1c709df;hp=c8d7d85016536e4485e85503fcb0fd6f676c9211;hpb=bc3e5787b547dc8aedaa0753cc23d975ae72f19a;p=gnus diff --git a/lisp/registry.el b/lisp/registry.el index c8d7d8501..5a35e1f0e 100644 --- a/lisp/registry.el +++ b/lisp/registry.el @@ -242,9 +242,9 @@ When SET is not nil, set it for VAL (use t for an empty list)." (defmethod registry-search ((db registry-db) &rest spec) "Search for SPEC across the registry-db THIS. -For example calling with :member '(a 1 2) will match entry '((a 3 1)). +For example calling with :member \\='(a 1 2) will match entry \\='((a 3 1)). Calling with :all t (any non-nil value) will match all. -Calling with :regex '\(a \"h.llo\") will match entry '((a \"hullo\" \"bye\"). +Calling with :regex \\='\(a \"h.llo\") will match entry \\='((a \"hullo\" \"bye\"). The test order is to check :all first, then :member, then :regex." (when db (let ((all (plist-get spec :all)) @@ -340,7 +340,7 @@ Errors out if the key exists already." (when (and (< 0 expected) (= 0 (mod count 1000))) (message "reindexing: %d of %d (%.2f%%)" - count expected (/ (* 100 count) expected))) + count expected (/ (* 100.0 count) expected))) (dolist (val (cdr-safe (assq tr v))) (let* ((value-keys (registry-lookup-secondary-value db tr val))) (push key value-keys) @@ -361,11 +361,12 @@ from the front of the list are deleted first. Returns the number of deleted entries." (let ((size (registry-size db)) - (target-size (- (oref db max-size) - (* (oref db max-size) - (oref db prune-factor)))) + (target-size + (floor (- (oref db max-size) + (* (oref db max-size) + (oref db prune-factor))))) candidates) - (if (> size (oref db max-size)) + (if (registry-full db) (progn (setq candidates (registry-collect-prune-candidates