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 ()