summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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))))