emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master e1a45c2: New option for making Gnus window layouts


From: Eric Abrahamsen
Subject: [Emacs-diffs] master e1a45c2: New option for making Gnus window layouts atomic
Date: Sat, 21 Sep 2019 21:42:15 -0400 (EDT)

branch: master
commit e1a45c26c4b951d1d2407c2f3075164866d8a0ea
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    New option for making Gnus window layouts atomic
    
    * lisp/gnus/gnus-win.el (gnus-use-atomic-windows): New boolean
      customization option.
      (gnus-configure-windows): When removing old window layouts, check
      for and remove atomicity.
      (gnus-configure-windows): When gnus-use-atomic-windows is non-nil,
      make Gnus window layouts atomic.
    * doc/misc/gnus.texi (Window Layout): Document.
---
 doc/misc/gnus.texi    |  8 ++++++++
 etc/NEWS              |  5 +++++
 lisp/gnus/gnus-win.el | 21 +++++++++++++++++++++
 3 files changed, 34 insertions(+)

diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index fb9581f..d535c1a 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -22923,6 +22923,14 @@ window is displayed vertically next to another window, 
you may also want
 to fiddle with @code{gnus-tree-minimize-window} to avoid having the
 windows resized.
 
+Lastly, it's possible to make Gnus window layouts ``atomic''
+(@xref{Atomic Windows, , Atomic Windows, elisp, The GNU Emacs Lisp
+Reference Manual}) by setting @code{gnus-use-atomic-windows} to
+@code{t}.  This will ensure that pop-up buffers (e.g. help or
+completion buffers), will appear below or to the side of the entire
+Gnus window layout and not, for example, squashed between the summary
+and article buffers.
+
 @subsection Window Configuration Names
 
 Here's a list of most of the currently known window configurations,
diff --git a/etc/NEWS b/etc/NEWS
index 20d2e62..166c133 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1032,6 +1032,11 @@ Of course it will still find it if you have it in 
'~/.ecompleterc'.
 ** Gnus
 
 +++
+*** New option 'gnus-use-atomic-windows' makes Gnus window layouts
+atomic.  See the "Atomic Windows" section of the Elisp manual for
+details.
+
++++
 *** There's a new value for 'gnus-article-date-headers',
 'combined-local-lapsed', which will show both the time (in the local
 timezone) and the lapsed time.
diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el
index e6906e9..cc3141c 100644
--- a/lisp/gnus/gnus-win.el
+++ b/lisp/gnus/gnus-win.el
@@ -39,6 +39,11 @@
   :group 'gnus-windows
   :type 'boolean)
 
+(defcustom gnus-use-atomic-windows t
+  "If non-nil, Gnus' window compositions will be atomic."
+  :type 'boolean
+  :version "27.1")
+
 (defcustom gnus-window-min-width 2
   "Minimum width of Gnus buffers."
   :group 'gnus-windows
@@ -402,6 +407,15 @@ See the Gnus manual for an explanation of the syntax 
used.")
         (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 (window-parameter nil 'window-atom)
+         (let ((root (window-atom-root)))
+           (walk-window-subtree
+            (lambda (win)
+              (set-window-parameter win 'window-atom nil))
+            root t)))
+
         ;; Either remove all windows or just remove all Gnus windows.
         (let ((frame (selected-frame)))
           (unwind-protect
@@ -423,6 +437,13 @@ See the Gnus manual for an explanation of the syntax 
used.")
           (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)))))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]