summaryrefslogtreecommitdiff
path: root/bog.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-03-04 23:23:53 -0500
committerKyle Meyer <kyle@kyleam.com>2016-03-04 23:23:53 -0500
commit54c83c5a123466fb0550698f485fb41270d79758 (patch)
tree094fda84335b228d9d3a35fb9a61fe675c7c589a /bog.el
parent0ba8df3f2d31d24f86deadc4369b7330efbac8c3 (diff)
downloadbog-54c83c5a123466fb0550698f485fb41270d79758.tar.gz
bog-clear-citekey-cache: Abort if cache is empty
Diffstat (limited to 'bog.el')
-rw-r--r--bog.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/bog.el b/bog.el
index a36bc0c..d00b62e 100644
--- a/bog.el
+++ b/bog.el
@@ -332,12 +332,15 @@ indicates to clear all categories. Interactively, clear all
categories when a single \\[universal-argument] is given.
Otherwise, prompt for CATEGORY."
(interactive
- (list (or (equal current-prefix-arg '(4))
- (and bog--citekey-cache
- (intern (completing-read
- "Category: "
- (mapcar (lambda (c) (symbol-name (car c)))
- bog--citekey-cache)))))))
+ (progn
+ (unless bog--citekey-cache
+ (user-error "Citekey cache is empty"))
+ (list (or (equal current-prefix-arg '(4))
+ (and bog--citekey-cache
+ (intern (completing-read
+ "Category: "
+ (mapcar (lambda (c) (symbol-name (car c)))
+ (or bog--citekey-cache)))))))))
(setq bog--citekey-cache
(and (not (eq category t))
(assq-delete-all category bog--citekey-cache))))