From 6acc970159578c95c94762f2a185aa2d4891ba40 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 14 Jun 2014 23:09:03 -0400 Subject: Stop compile from making duplicate buffers --- lisp/init-external.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lisp') diff --git a/lisp/init-external.el b/lisp/init-external.el index 115c060..8e0f3db 100644 --- a/lisp/init-external.el +++ b/lisp/init-external.el @@ -48,6 +48,15 @@ is non-nil." ;;; Compilation +(defadvice compile (around prevent-duplicate-compilation-windows activate) + "Pop to compilation buffer only if it isn't visible. +This is useful for using multiple frames (e.g., with a two +monitor setup)." + (if (get-buffer-window "*compilation*" 'visible) + (save-window-excursion + ad-do-it) + ad-do-it)) + (defadvice recompile (around prevent-window-on-compilation activate) "Prevent recompiling from spawning new windows." (save-window-excursion -- cgit v1.2.3