unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Understanding atomic window groups
@ 2019-05-22 17:50 Eric Abrahamsen
  2019-05-23  8:39 ` martin rudalics
  0 siblings, 1 reply; 20+ messages in thread
From: Eric Abrahamsen @ 2019-05-22 17:50 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1063 bytes --]

I'm playing around with adding atomic window support to Gnus, so that
help/completion/other-pop-up buffers don't end up squished between the
*Summary* and *Article* windows, but instead shift the whole window
composition over temporarily.

All of Gnus' window configuration goes through one function,
`gnus-configure-windows', so it's relatively easy to target. The patch
below seems to do the trick.

My question is about quitting/removing atomic window compositions. Gnus
switches through many different compositions, so it's necessary to be
able to quit atomic windows. As you can see in the diff, I've had to
manually, and recursively, remove the 'window-atom parameter before
reconfiguring windows.

Is that the way it's supposed to work? I guess I would have thought
there would be an easier way of getting rid of an atomic
configuration -- like `quit-window' in any of the windows would quit all
of them, or something like that. Instead, `quit-window' seems to just
signal an error.

Is this how it's supposed to work? Should I be doing this differently?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-atomic-windows.diff --]
[-- Type: text/x-patch, Size: 1819 bytes --]

commit 80e9ac12529016a69926dfdc0b1ff6cf619a0751
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
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)))))))))

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2019-06-15 15:47 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-22 17:50 Understanding atomic window groups Eric Abrahamsen
2019-05-23  8:39 ` martin rudalics
2019-05-23 20:14   ` Eric Abrahamsen
2019-05-24  8:01     ` martin rudalics
2019-05-24  8:24       ` Eli Zaretskii
2019-05-24 21:32       ` Eric Abrahamsen
2019-05-25  7:59         ` martin rudalics
2019-05-25  8:13           ` Eli Zaretskii
2019-06-03  9:11             ` martin rudalics
2019-06-03 15:10               ` Eli Zaretskii
2019-05-25 16:26           ` Eric Abrahamsen
2019-05-25 17:54             ` Eric Abrahamsen
2019-06-03  9:13               ` martin rudalics
2019-06-03  9:12             ` martin rudalics
2019-06-03 21:03               ` Eric Abrahamsen
2019-06-04  8:20                 ` martin rudalics
2019-06-04 17:28                   ` Eric Abrahamsen
2019-06-11 21:07                   ` Eric Abrahamsen
2019-06-15  8:16                     ` martin rudalics
2019-06-15 15:47                       ` Eric Abrahamsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).