Last active
August 24, 2017 03:15
-
-
Save ffevotte/d7e69cf147c014381003 to your computer and use it in GitHub Desktop.
Complement to SO answer: "How do I make the compilation window in Emacs to always be a certain size?" (http://stackoverflow.com/a/9728357/1225607)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my-select-bottom-window () | |
(let ((bottom-window (selected-window)) | |
window-below) | |
(while (setq window-below (window-in-direction 'below bottom-window)) | |
(setq bottom-window window-below)) | |
(select-window bottom-window))) | |
(defun my-compilation-hook () | |
(when (not (get-buffer-window "*compilation*")) | |
(save-selected-window | |
(save-excursion | |
(my-select-bottom-window) | |
(let* ((w (split-window-vertically)) | |
(h (window-height w))) | |
(select-window w) | |
(switch-to-buffer "*compile5*") | |
(shrink-window (- h compilation-window-height))))))) | |
(add-hook 'compilation-mode-hook 'my-compilation-hook) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment