From 36ebaafbc82328f8cb15105c915661a98c47cb0f Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 18 Sep 2012 20:22:58 +0200 Subject: [PATCH] Don't show other windows in bottom window If possible. --- bw.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bw.el b/bw.el index 0c4844d..322beb3 100644 --- a/bw.el +++ b/bw.el @@ -66,8 +66,19 @@ (local-set-key (kbd "C-c C-q") 'delete-window) win)) +(defun bw-display-in-other-window (buffer alist) + "Show BUFFER in any window that is not the bottom window. + +Discard ALIST." + (let ((win (get-buffer-window buffer))) + (when (window-parameter win 'bw-bottom) + (setq win (next-window win 'no))) + (set-window-buffer win buffer))) + (add-to-list 'display-buffer-alist '("^\\*.*\\*$" . ((bw-display-in-bottom-window . nil)))) +(add-to-list 'display-buffer-alist + '(".*" . ((bw-display-in-other-window . nil))) t) (add-to-list 'window-persistent-parameters (cons 'bw-bottom t)) (defun bw-find-appropriate-buffer ()