From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#35873: Add atomic window support to Gnus Date: Thu, 23 May 2019 13:45:13 -0700 Message-ID: <87h89kuch2.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="239883"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: 35873@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 23 22:54:52 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTujj-0010JS-Rm for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 May 2019 22:54:52 +0200 Original-Received: from localhost ([127.0.0.1]:43194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTuji-00063s-Ll for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 May 2019 16:54:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTubD-0007Rb-KE for bug-gnu-emacs@gnu.org; Thu, 23 May 2019 16:46:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTubC-0004M6-Bc for bug-gnu-emacs@gnu.org; Thu, 23 May 2019 16:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60105) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTubC-0004Lr-4l for bug-gnu-emacs@gnu.org; Thu, 23 May 2019 16:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hTubB-00068n-W1; Thu, 23 May 2019 16:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Thu, 23 May 2019 20:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35873 X-GNU-PR-Package: emacs,gnus X-Debbugs-Original-To: submit@debbugs.gnu.org (The Gnus Bugfixing Girls + Boys) Original-Received: via spool by submit@debbugs.gnu.org id=B.155864432423557 (code B ref -1); Thu, 23 May 2019 20:46:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 May 2019 20:45:24 +0000 Original-Received: from localhost ([127.0.0.1]:45415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTuaZ-00067t-Tg for submit@debbugs.gnu.org; Thu, 23 May 2019 16:45:24 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:58368 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTuaX-00067d-Ss for submit@debbugs.gnu.org; Thu, 23 May 2019 16:45:22 -0400 Original-Received: from localhost (50-251-205-17-static.hfc.comcastbusiness.net [50.251.205.17]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id C774CFA022 for ; Thu, 23 May 2019 20:45:14 +0000 (UTC) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:159690 Archived-At: --=-=-= Content-Type: text/plain 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 . . 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 . . --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-atomic-window-support-to-Gnus.patch >From 48b94c157144230f9e955d4b94202ee152f3d820 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen 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 --=-=-=--