diff options
| author | Eric Abrahamsen | 2019-04-21 11:04:20 -0700 |
|---|---|---|
| committer | Eric Abrahamsen | 2019-09-21 18:41:22 -0700 |
| commit | e1a45c26c4b951d1d2407c2f3075164866d8a0ea (patch) | |
| tree | 728b1e1947db036248a827ab1cae068f0e6b4338 | |
| parent | 14e7c01feeafd3852522c221187e7359d21079f5 (diff) | |
| download | emacs-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.texi | 8 | ||||
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/gnus/gnus-win.el | 21 |
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 | |||
| 22923 | to fiddle with @code{gnus-tree-minimize-window} to avoid having the | 22923 | to fiddle with @code{gnus-tree-minimize-window} to avoid having the |
| 22924 | windows resized. | 22924 | windows resized. |
| 22925 | 22925 | ||
| 22926 | Lastly, it's possible to make Gnus window layouts ``atomic'' | ||
| 22927 | (@xref{Atomic Windows, , Atomic Windows, elisp, The GNU Emacs Lisp | ||
| 22928 | Reference Manual}) by setting @code{gnus-use-atomic-windows} to | ||
| 22929 | @code{t}. This will ensure that pop-up buffers (e.g. help or | ||
| 22930 | completion buffers), will appear below or to the side of the entire | ||
| 22931 | Gnus window layout and not, for example, squashed between the summary | ||
| 22932 | and article buffers. | ||
| 22933 | |||
| 22926 | @subsection Window Configuration Names | 22934 | @subsection Window Configuration Names |
| 22927 | 22935 | ||
| 22928 | Here's a list of most of the currently known window configurations, | 22936 | Here's a list of most of the currently known window configurations, |
| @@ -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 | ||
| 1036 | atomic. See the "Atomic Windows" section of the Elisp manual for | ||
| 1037 | details. | ||
| 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 |
| 1037 | timezone) and the lapsed time. | 1042 | timezone) 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))))))))) |