diff options
author | Kyle Meyer <kyle@kyleam.com> | 2016-03-04 23:23:53 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2016-03-04 23:23:53 -0500 |
commit | 54c83c5a123466fb0550698f485fb41270d79758 (patch) | |
tree | 094fda84335b228d9d3a35fb9a61fe675c7c589a /bog.el | |
parent | 0ba8df3f2d31d24f86deadc4369b7330efbac8c3 (diff) | |
download | bog-54c83c5a123466fb0550698f485fb41270d79758.tar.gz |
bog-clear-citekey-cache: Abort if cache is empty
Diffstat (limited to 'bog.el')
-rw-r--r-- | bog.el | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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)))) |