;;; registry.el --- Track and remember data items by various fields
-;; Copyright (C) 2011-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2016 Free Software Foundation, Inc.
;; Author: Teodor Zlatanov <tzz@lifelogs.com>
;; Keywords: data
:initform 0.1
:type float
:custom float
- :documentation "Prune to \(:max-size * :prune-factor\) less
+ :documentation "Prune to (:max-size * :prune-factor) less
than the :max-size limit. Should be a float between 0 and 1.")
(tracked :initarg :tracked
:initform nil
(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)).
-Calling with :all t (any non-nil value) will match all.
-Calling with :regex '\(a \"h.llo\") will match entry '((a \"hullo\" \"bye\").
+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\").
The test order is to check :all first, then :member, then :regex."
(when db
(let ((all (plist-get spec :all))
(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)
"Prunes the registry-db object DB.
Attempts to prune the number of entries down to \(*
-:max-size :prune-factor\) less than the max-size limit, so
+:max-size :prune-factor) less than the max-size limit, so
pruning doesn't need to happen on every save. Removes only
entries without the :precious keys, so it may not be possible to
reach the target limit.