diff options
| author | Teodor Zlatanov | 2011-05-13 04:12:37 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2011-05-13 04:12:37 +0000 |
| commit | 652aa4650422227f0e510a787747fcab2f452292 (patch) | |
| tree | a4e100a5bea447ab069f637a13e853ec6f7af46d | |
| parent | f0dd243b58eb4240bb2da121029903539e614c94 (diff) | |
| download | emacs-652aa4650422227f0e510a787747fcab2f452292.tar.gz emacs-652aa4650422227f0e510a787747fcab2f452292.zip | |
registry.el (prune-factor): New initialization parameter defaulting to 0.1.
(registry-prune-hard): Use it.
gnus-registry.el (gnus-registry-fixup-registry): Set prune-factor to 0.1 expicitly.
| -rw-r--r-- | lisp/gnus/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/gnus/gnus-registry.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/registry.el | 15 |
3 files changed, 22 insertions, 4 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index ceea1e0375f..6f4bc302570 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2011-05-13 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 2 | |||
| 3 | * registry.el (prune-factor): New initialization parameter defaulting | ||
| 4 | to 0.1. | ||
| 5 | (registry-prune-hard): Use it. | ||
| 6 | |||
| 7 | * gnus-registry.el (gnus-registry-fixup-registry): Set prune-factor to | ||
| 8 | 0.1 expicitly. | ||
| 9 | |||
| 1 | 2011-05-13 Glenn Morris <rgm@gnu.org> | 10 | 2011-05-13 Glenn Morris <rgm@gnu.org> |
| 2 | 11 | ||
| 3 | * message.el (message-send-mail-with-sendmail): Assume sendmail-program | 12 | * message.el (message-send-mail-with-sendmail): Assume sendmail-program |
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index 02e4ce7e2e6..25d84b11d41 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el | |||
| @@ -244,6 +244,8 @@ the Bit Bucket." | |||
| 244 | (oset db :max-hard | 244 | (oset db :max-hard |
| 245 | (or gnus-registry-max-entries | 245 | (or gnus-registry-max-entries |
| 246 | most-positive-fixnum)) | 246 | most-positive-fixnum)) |
| 247 | (oset db :prune-factor | ||
| 248 | 0.1) | ||
| 247 | (oset db :max-soft | 249 | (oset db :max-soft |
| 248 | (or gnus-registry-max-pruned-entries | 250 | (or gnus-registry-max-pruned-entries |
| 249 | most-positive-fixnum)) | 251 | most-positive-fixnum)) |
diff --git a/lisp/gnus/registry.el b/lisp/gnus/registry.el index b5cc3ec0e2b..8e158f7ca0f 100644 --- a/lisp/gnus/registry.el +++ b/lisp/gnus/registry.el | |||
| @@ -116,6 +116,12 @@ | |||
| 116 | :type integer | 116 | :type integer |
| 117 | :custom integer | 117 | :custom integer |
| 118 | :documentation "Prune as much as possible to get to this size.") | 118 | :documentation "Prune as much as possible to get to this size.") |
| 119 | (prune-factor | ||
| 120 | :initarg :prune-factor | ||
| 121 | :initform 0.1 | ||
| 122 | :type float | ||
| 123 | :custom float | ||
| 124 | :documentation "At the max-hard limit, prune size * this entries.") | ||
| 119 | (tracked :initarg :tracked | 125 | (tracked :initarg :tracked |
| 120 | :initform nil | 126 | :initform nil |
| 121 | :type t | 127 | :type t |
| @@ -357,11 +363,12 @@ Proposes only entries without the :precious keys." | |||
| 357 | 363 | ||
| 358 | (defmethod registry-prune-hard-candidates ((db registry-db)) | 364 | (defmethod registry-prune-hard-candidates ((db registry-db)) |
| 359 | "Collects pruning candidates from the registry-db object THIS. | 365 | "Collects pruning candidates from the registry-db object THIS. |
| 360 | Proposes any entries over the max-hard limit minus 10." | 366 | Proposes any entries over the max-hard limit minus size * prune-factor." |
| 361 | (let* ((data (oref db :data)) | 367 | (let* ((data (oref db :data)) |
| 362 | ;; prune to 10 below the max-hard limit so we're not | 368 | ;; prune to (size * prune-factor) below the max-hard limit so |
| 363 | ;; pruning all the time | 369 | ;; we're not pruning all the time |
| 364 | (limit (- (oref db :max-hard) 10)) | 370 | (limit (max 0 (- (oref db :max-hard) |
| 371 | (* (registry-size db) (oref db :prune-factor))))) | ||
| 365 | (candidates (loop for k being the hash-keys of data | 372 | (candidates (loop for k being the hash-keys of data |
| 366 | collect k))) | 373 | collect k))) |
| 367 | (list limit candidates)))) | 374 | (list limit candidates)))) |