summaryrefslogtreecommitdiff
path: root/bog.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-02-17 21:46:22 -0500
committerKyle Meyer <kyle@kyleam.com>2015-02-17 21:46:22 -0500
commitbb7d073cdbbf9afb2b1f48db0fd70cae88305c1b (patch)
treef023774ad6536d4d41dd1a3224a6926c9290d28b /bog.el
parent16b0cd1e44eb82d084f2238aec164f39e610d081 (diff)
downloadbog-bb7d073cdbbf9afb2b1f48db0fd70cae88305c1b.tar.gz
Clean up previous duplicate heading buffer
When bog-list-duplicate-heading-citekeys doesn't find any duplicate headings, check for a buffer from a previous call. If one is found, kill it because its information is now stale.
Diffstat (limited to 'bog.el')
-rw-r--r--bog.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/bog.el b/bog.el
index c5483a6..bc5412b 100644
--- a/bog.el
+++ b/bog.el
@@ -425,7 +425,9 @@ is only active if `bog-use-citekey-cache' is non-nil)."
(dup-cks (sort (bog--find-duplicates (bog-all-heading-citekeys))
#'string-lessp)))
(if (not dup-cks)
- (message "No duplicate citekeys found")
+ (progn (message "No duplicate citekeys found")
+ (and (get-buffer bufname)
+ (kill-buffer bufname)))
(with-current-buffer (get-buffer-create bufname)
(erase-buffer)
(insert (mapconcat #'identity dup-cks "\n"))