diff --git a/emacs/.emacs b/emacs/.emacs index e21dc5a..6f9a46a 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -216,26 +216,26 @@ (setq compilation-scroll-output 'first-error) (setq compilation-window-height 10) -(defun my/compilation-bury-buffer-without-error (buffer string) - (cond ((string-match "finished" string) - (message "Build maybe successful: closing window.") - (run-with-timer 3 nil - 'delete-window - (get-buffer-window buffer t))) - (t (message "Compilation exited abnormaly: %s" string)))) - -(setq compilation-finish-function 'my/compilation-bury-buffer-without-error) +;(defun my/compilation-bury-buffer-without-error (buffer string) +; (cond ((string-match "finished" string) +; (message "Build maybe successful: closing window.") +; (run-with-timer 3 nil +; 'delete-window +; (get-buffer-window buffer t))) +; (t (message "Compilation exited abnormaly: %s" string)))) +; +;(setq compilation-finish-function 'my/compilation-bury-buffer-without-error) -(defun my/setup-compilation-window () - (when (not (get-buffer-window "*compilation*")) - (save-selected-window - (save-excursion - (let* ((w (split-window-vertically)) - (h (window-height w))) - (select-window w) - (switch-to-buffer "*compilation*") - (shrink-window (- h compilation-window-height))))))) -(add-hook 'compilation-mode-hook 'my/setup-compilation-window) +;(defun my/setup-compilation-window () +; (when (not (get-buffer-window "*compilation*")) +; (save-selected-window +; (save-excursion +; (let* ((w (split-window-vertically)) +; (h (window-height w))) +; (select-window w) +; (switch-to-buffer "*compilation*") +; (shrink-window (- h compilation-window-height))))))) +;(add-hook 'compilation-mode-hook 'my/setup-compilation-window) ;; Window movement ; Old keys @@ -291,6 +291,8 @@ '("*Apropos*" display-buffer-same-window)) (add-to-list 'display-buffer-alist '("*Help*" display-buffer-in-side-window)) +(add-to-list 'display-buffer-alist + '("*compilation*" (display-buffer-reuse-window display-buffer-in-side-window) (side . bottom) (size . 0.2))) ;; Change all prompts to y or n (fset 'yes-or-no-p 'y-or-n-p)