Skip to content

Commit

Permalink
Don't call alert with a killed buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed Oct 24, 2016
1 parent 61dacdc commit 056722f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lisp/init-compile.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

(defun sanityinc/alert-after-compilation-finish (buf result)
"Use `alert' to report compilation RESULT if BUF is hidden."
(unless (catch 'is-visible
(when (buffer-live-p buf)
(when (buffer-live-p buf)
(unless (catch 'is-visible
(walk-windows (lambda (w)
(when (eq (window-buffer w) buf)
(throw 'is-visible t)))))
nil)
(alert (concat "Compilation " result)
:buffer buf
:category 'compilation)))
(throw 'is-visible t))))
nil)
(alert (concat "Compilation " result)
:buffer buf
:category 'compilation))))

(after-load 'compile
(add-hook 'compilation-finish-functions
Expand Down

0 comments on commit 056722f

Please sign in to comment.