shell-pop und bessere Lösung für compilation

This commit is contained in:
madmaurice 2017-05-24 19:18:06 +02:00
parent 4cc4317c82
commit 5fad0abd17

View file

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