From bb7d073cdbbf9afb2b1f48db0fd70cae88305c1b Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 17 Feb 2015 21:46:22 -0500 Subject: 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. --- bog.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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")) -- cgit v1.2.3