commit 80e9ac12529016a69926dfdc0b1ff6cf619a0751 Author: Eric Abrahamsen Date: Sun Apr 21 11:04:20 2019 -0700 WIP on making Gnus windows atomic diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el index 5f7154c545..d30c8b84ad 100644 --- a/lisp/gnus/gnus-win.el +++ b/lisp/gnus/gnus-win.el @@ -38,6 +38,10 @@ gnus-use-full-window :group 'gnus-windows :type 'boolean) +(defcustom gnus-use-atomic-windows t + "If non-nil, Gnus' window compositions will be atomic." + :type 'boolean) + (defcustom gnus-window-min-width 2 "Minimum width of Gnus buffers." :group 'gnus-windows @@ -401,6 +405,15 @@ gnus-configure-windows (unless (gnus-buffer-live-p nntp-server-buffer) (nnheader-init-server-buffer)) + ;; Remove all 'window-atom parameters, as we're going to blast + ;; and recreate the window layout. + (when-let ((parent (window-parent (selected-window)))) + (when (window-parameter parent 'window-atom) + (walk-window-subtree + (lambda (win) + (set-window-parameter win 'window-atom nil)) + parent t))) + ;; Either remove all windows or just remove all Gnus windows. (let ((frame (selected-frame))) (unwind-protect @@ -422,6 +435,13 @@ gnus-configure-windows (set-buffer nntp-server-buffer) (gnus-configure-frame split) (run-hooks 'gnus-configure-windows-hook) + + ;; If we're using atomic windows, and the current frame has + ;; multiple windows, make them atomic. + (when (and gnus-use-atomic-windows + (window-parent (selected-window))) + (window-make-atom (window-parent (selected-window)))) + (when gnus-window-frame-focus (select-frame-set-input-focus (window-frame gnus-window-frame-focus)))))))))