summaryrefslogtreecommitdiff
path: root/bog.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-01-23 21:31:09 -0500
committerKyle Meyer <kyle@kyleam.com>2016-01-23 21:31:09 -0500
commitb7cacf62850c3d7376d70501694d0044b8e778b4 (patch)
tree81bca72c26c23073ea8eadced30373a1744d07cf /bog.el
parent2cefc2c03ab152e0c8aef6152811a149d2ede5ca (diff)
downloadbog-b7cacf62850c3d7376d70501694d0044b8e778b4.tar.gz
bog--with-citekey-cache: Use uninterned symbol
Diffstat (limited to 'bog.el')
-rw-r--r--bog.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/bog.el b/bog.el
index 2049fc2..4bc8427 100644
--- a/bog.el
+++ b/bog.el
@@ -281,15 +281,16 @@ Keys match values in `bog-use-citekey-cache'.")
Use cached values if `bog-use-citekey-cache' is non-nil for KEY.
Cached values are updated to the return values of BODY."
(declare (indent 1))
- `(let* ((use-cache-p (bog--use-cache-p ,key))
- (citekeys (or (and use-cache-p
- (cdr (assq ,key bog--citekey-cache)))
- ,@body)))
- (when use-cache-p
- (setq bog--citekey-cache
- (cons (cons ,key citekeys)
- (assq-delete-all ,key bog--citekey-cache))))
- citekeys))
+ (let ((use-cache-p (cl-gensym "use-cache-p")))
+ `(let* ((,use-cache-p (bog--use-cache-p ,key))
+ (citekeys (or (and ,use-cache-p
+ (cdr (assq ,key bog--citekey-cache)))
+ ,@body)))
+ (when ,use-cache-p
+ (setq bog--citekey-cache
+ (cons (cons ,key citekeys)
+ (assq-delete-all ,key bog--citekey-cache))))
+ citekeys)))
(defun bog-clear-citekey-cache (category)
"Clear cache of citekeys for CATEGORY.