diff options
author | Kyle Meyer <kyle@kyleam.com> | 2016-01-23 21:31:09 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2016-01-23 21:31:09 -0500 |
commit | b7cacf62850c3d7376d70501694d0044b8e778b4 (patch) | |
tree | 81bca72c26c23073ea8eadced30373a1744d07cf | |
parent | 2cefc2c03ab152e0c8aef6152811a149d2ede5ca (diff) | |
download | bog-b7cacf62850c3d7376d70501694d0044b8e778b4.tar.gz |
bog--with-citekey-cache: Use uninterned symbol
-rw-r--r-- | bog.el | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -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. |