aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Abrahamsen2019-04-21 11:04:20 -0700
committerEric Abrahamsen2019-09-21 18:41:22 -0700
commite1a45c26c4b951d1d2407c2f3075164866d8a0ea (patch)
tree728b1e1947db036248a827ab1cae068f0e6b4338
parent14e7c01feeafd3852522c221187e7359d21079f5 (diff)
downloademacs-e1a45c26c4b951d1d2407c2f3075164866d8a0ea.tar.gz
emacs-e1a45c26c4b951d1d2407c2f3075164866d8a0ea.zip
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.
-rw-r--r--doc/misc/gnus.texi8
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/gnus/gnus-win.el21
3 files changed, 34 insertions, 0 deletions
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index fb9581f9853..d535c1a49ef 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
22923to fiddle with @code{gnus-tree-minimize-window} to avoid having the 22923to fiddle with @code{gnus-tree-minimize-window} to avoid having the
22924windows resized. 22924windows resized.
22925 22925
22926Lastly, it's possible to make Gnus window layouts ``atomic''
22927(@xref{Atomic Windows, , Atomic Windows, elisp, The GNU Emacs Lisp
22928Reference Manual}) by setting @code{gnus-use-atomic-windows} to
22929@code{t}. This will ensure that pop-up buffers (e.g. help or
22930completion buffers), will appear below or to the side of the entire
22931Gnus window layout and not, for example, squashed between the summary
22932and article buffers.
22933
22926@subsection Window Configuration Names 22934@subsection Window Configuration Names
22927 22935
22928Here's a list of most of the currently known window configurations, 22936Here's a list of most of the currently known window configurations,
diff --git a/etc/NEWS b/etc/NEWS
index 20d2e62bd3b..166c13363f0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1032,6 +1032,11 @@ Of course it will still find it if you have it in '~/.ecompleterc'.
1032** Gnus 1032** Gnus
1033 1033
1034+++ 1034+++
1035*** New option 'gnus-use-atomic-windows' makes Gnus window layouts
1036atomic. See the "Atomic Windows" section of the Elisp manual for
1037details.
1038
1039+++
1035*** There's a new value for 'gnus-article-date-headers', 1040*** There's a new value for 'gnus-article-date-headers',
1036'combined-local-lapsed', which will show both the time (in the local 1041'combined-local-lapsed', which will show both the time (in the local
1037timezone) and the lapsed time. 1042timezone) and the lapsed time.
diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el
index e6906e99bb2..cc3141cf631 100644
--- a/lisp/gnus/gnus-win.el
+++ b/lisp/gnus/gnus-win.el
@@ -39,6 +39,11 @@
39 :group 'gnus-windows 39 :group 'gnus-windows
40 :type 'boolean) 40 :type 'boolean)
41 41
42(defcustom gnus-use-atomic-windows t
43 "If non-nil, Gnus' window compositions will be atomic."
44 :type 'boolean
45 :version "27.1")
46
42(defcustom gnus-window-min-width 2 47(defcustom gnus-window-min-width 2
43 "Minimum width of Gnus buffers." 48 "Minimum width of Gnus buffers."
44 :group 'gnus-windows 49 :group 'gnus-windows
@@ -402,6 +407,15 @@ See the Gnus manual for an explanation of the syntax used.")
402 (unless (gnus-buffer-live-p nntp-server-buffer) 407 (unless (gnus-buffer-live-p nntp-server-buffer)
403 (nnheader-init-server-buffer)) 408 (nnheader-init-server-buffer))
404 409
410 ;; Remove all 'window-atom parameters, as we're going to blast
411 ;; and recreate the window layout.
412 (when (window-parameter nil 'window-atom)
413 (let ((root (window-atom-root)))
414 (walk-window-subtree
415 (lambda (win)
416 (set-window-parameter win 'window-atom nil))
417 root t)))
418
405 ;; Either remove all windows or just remove all Gnus windows. 419 ;; Either remove all windows or just remove all Gnus windows.
406 (let ((frame (selected-frame))) 420 (let ((frame (selected-frame)))
407 (unwind-protect 421 (unwind-protect
@@ -423,6 +437,13 @@ See the Gnus manual for an explanation of the syntax used.")
423 (set-buffer nntp-server-buffer) 437 (set-buffer nntp-server-buffer)
424 (gnus-configure-frame split) 438 (gnus-configure-frame split)
425 (run-hooks 'gnus-configure-windows-hook) 439 (run-hooks 'gnus-configure-windows-hook)
440
441 ;; If we're using atomic windows, and the current frame has
442 ;; multiple windows, make them atomic.
443 (when (and gnus-use-atomic-windows
444 (window-parent (selected-window)))
445 (window-make-atom (window-parent (selected-window))))
446
426 (when gnus-window-frame-focus 447 (when gnus-window-frame-focus
427 (select-frame-set-input-focus 448 (select-frame-set-input-focus
428 (window-frame gnus-window-frame-focus))))))))) 449 (window-frame gnus-window-frame-focus)))))))))