From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: 35873@debbugs.gnu.org
Subject: bug#35873: Add atomic window support to Gnus
Date: Thu, 23 May 2019 13:45:13 -0700 [thread overview]
Message-ID: <87h89kuch2.fsf@ericabrahamsen.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]
The attached patch adds atomic window support with a new customization
option, `gnus-use-atomic-windows', defaulting to nil. If t, a
multi-window Gnus layout will be treated as a single window when other
code pops up buffers. Ie, your completions buffer won't end up squished
between the summary and article buffers.
I'm pretty sure I've done the elisp manual cross reference incorrectly.
Thanks,
Eric
Gnus v5.13
GNU Emacs 27.0.50 (build 15, x86_64-pc-linux-gnu, GTK+ Version 3.24.8)
of 2019-05-23
200 news.gmane.org InterNetNews NNRP server INN 2.6.1 ready (posting ok)
100 Legal commands
ARTICLE [message-ID|number]
AUTHINFO USER name|PASS password|SASL mechanism [initial-response]|GENERIC program [argument ...]
BODY [message-ID|number]
CAPABILITIES [keyword]
COMPRESS DEFLATE
DATE
GROUP newsgroup
HDR header [message-ID|range]
HEAD [message-ID|number]
HELP
IHAVE message-ID
LAST
LIST [ACTIVE [wildmat]|ACTIVE.TIMES [wildmat]|COUNTS [wildmat]|DISTRIB.PATS|DISTRIBUTIONS|HEADERS [MSGID|RANGE]|MODERATORS|MOTD|NEWSGROUPS [wildmat]|OVERVIEW.FMT|SUBSCRIPTIONS [wildmat]]
LISTGROUP [newsgroup [range]]
MODE READER
NEWGROUPS [yy]yymmdd hhmmss [GMT]
NEWNEWS wildmat [yy]yymmdd hhmmss [GMT]
NEXT
OVER [range]
POST
QUIT
STARTTLS
STAT [message-ID|number]
XGTITLE [wildmat]
XHDR header [message-ID|range]
XOVER [range]
XPAT header message-ID|range pattern [pattern ...]
Report problems to <usenet@blaine.gmane.org>.
.
382 Begin TLS negotiation now
100 Legal commands
ARTICLE [message-ID|number]
AUTHINFO USER name|PASS password|SASL mechanism [initial-response]|GENERIC program [argument ...]
BODY [message-ID|number]
CAPABILITIES [keyword]
COMPRESS DEFLATE
DATE
GROUP newsgroup
HDR header [message-ID|range]
HEAD [message-ID|number]
HELP
IHAVE message-ID
LAST
LIST [ACTIVE [wildmat]|ACTIVE.TIMES [wildmat]|COUNTS [wildmat]|DISTRIB.PATS|DISTRIBUTIONS|HEADERS [MSGID|RANGE]|MODERATORS|MOTD|NEWSGROUPS [wildmat]|OVERVIEW.FMT|SUBSCRIPTIONS [wildmat]]
LISTGROUP [newsgroup [range]]
MODE READER
NEWGROUPS [yy]yymmdd hhmmss [GMT]
NEWNEWS wildmat [yy]yymmdd hhmmss [GMT]
NEXT
OVER [range]
POST
QUIT
STARTTLS
STAT [message-ID|number]
XGTITLE [wildmat]
XHDR header [message-ID|range]
XOVER [range]
XPAT header message-ID|range pattern [pattern ...]
Report problems to <usenet@blaine.gmane.org>.
.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-atomic-window-support-to-Gnus.patch --]
[-- Type: text/x-patch, Size: 2800 bytes --]
From 48b94c157144230f9e955d4b94202ee152f3d820 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Thu, 23 May 2019 13:41:47 -0700
Subject: [PATCH] Add atomic window support to Gnus
* lisp/gnus/gnus-win.el (gnus-use-atomic-windows): New option
governing behavior, default to nil.
(gnus-configure-windows): Add and remove 'atomic-window parameter
when switching window configurations.
* doc/misc/gnus.texi (Window Layout): Document.
---
doc/misc/gnus.texi | 6 ++++++
lisp/gnus/gnus-win.el | 18 ++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index b9c91a02a3..c09d9dc47f 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -22918,6 +22918,12 @@ Window Layout
to fiddle with @code{gnus-tree-minimize-window} to avoid having the
windows resized.
+@vindex gnus-use-atomic-windows
+Lastly, when you've got a multiple-window layout, Gnus can treat them
+as one ``atomic window'' with regards to help or completion pop-up
+windows (@pxref{Atomic Windows, , Atomic Windows, elisp}). Set @code{gnus-use-atomic-windows}
+to a non-@code{nil} value to enable this.
+
@subsection Window Configuration Names
Here's a list of most of the currently known window configurations,
diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el
index 40c5b42d45..04d9e40884 100644
--- a/lisp/gnus/gnus-win.el
+++ b/lisp/gnus/gnus-win.el
@@ -39,6 +39,10 @@ gnus-use-full-window
:group 'gnus-windows
:type 'boolean)
+(defcustom gnus-use-atomic-windows nil
+ "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
@@ -402,6 +406,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 (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 +436,11 @@ gnus-configure-windows
(set-buffer nntp-server-buffer)
(gnus-configure-frame split)
(run-hooks 'gnus-configure-windows-hook)
+
+ (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)))))))))
--
2.21.0
next reply other threads:[~2019-05-23 20:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-23 20:45 Eric Abrahamsen [this message]
2019-06-21 9:10 ` bug#35873: Add atomic window support to Gnus Noam Postavsky
2019-06-21 15:11 ` Eric Abrahamsen
2019-06-22 11:55 ` Lars Ingebrigtsen
2019-06-22 16:41 ` Eric Abrahamsen
2019-09-16 21:05 ` Lars Ingebrigtsen
2019-09-16 22:42 ` Eric Abrahamsen
2019-09-16 22:43 ` Lars Ingebrigtsen
2019-09-19 17:21 ` Eric Abrahamsen
2019-09-20 8:13 ` martin rudalics
2019-09-20 18:12 ` Eric Abrahamsen
2019-09-20 19:28 ` Eric Abrahamsen
2019-09-20 20:19 ` Lars Ingebrigtsen
2019-09-20 20:41 ` Eric Abrahamsen
2019-09-28 18:00 ` Lars Ingebrigtsen
2019-09-20 20:49 ` Eric Abrahamsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h89kuch2.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=35873@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).