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: Fri, 20 Sep 2019 12:28:05 -0700 Message-ID: <87v9tmydh6.fsf@ericabrahamsen.net> References: <87h89kuch2.fsf@ericabrahamsen.net> <87imsxy3lj.fsf@ericabrahamsen.net> <87a7b4q7ed.fsf@gnus.org> <87a7b3eucz.fsf@ericabrahamsen.net> <875zlrq2v9.fsf@gnus.org> <87o8zgnqvx.fsf@ericabrahamsen.net> <878sqizvjf.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="66238"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , 35873@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 20 21:29:20 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iBOal-000H59-Hc for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Sep 2019 21:29:19 +0200 Original-Received: from localhost ([::1]:34978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBOak-0007Z7-28 for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Sep 2019 15:29:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33470) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBOaX-0007Wh-4X for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2019 15:29:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBOaU-0000yq-Ia for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2019 15:29:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49737) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBOaU-0000yl-D6 for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2019 15:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iBOaU-0008ES-7T; Fri, 20 Sep 2019 15:29: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: Fri, 20 Sep 2019 19:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35873 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: patch Original-Received: via spool by 35873-submit@debbugs.gnu.org id=B35873.156900769631572 (code B ref 35873); Fri, 20 Sep 2019 19:29:02 +0000 Original-Received: (at 35873) by debbugs.gnu.org; 20 Sep 2019 19:28:16 +0000 Original-Received: from localhost ([127.0.0.1]:58557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBOZj-0008D9-SI for submit@debbugs.gnu.org; Fri, 20 Sep 2019 15:28:16 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:40562 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBOZh-0008Ct-RN for 35873@debbugs.gnu.org; Fri, 20 Sep 2019 15:28:14 -0400 Original-Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 131E6FA025; Fri, 20 Sep 2019 19:28:06 +0000 (UTC) In-Reply-To: <878sqizvjf.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Fri, 20 Sep 2019 11:12:36 -0700") 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:166797 Archived-At: --=-=-= Content-Type: text/plain Eric Abrahamsen writes: > martin rudalics writes: > >>> I updated the patch with Martin's suggestion, and am back to running >>> this daily. One thing I noticed is that (in this case in my Gnorb >>> package) running `delete-other-windows' from a Gnus window will now >>> result in one of these: >>> >>> delete-other-windows: Root of atomic window is root window of its frame >>> >>> That error is expected with atomic windows. I can change Gnorb to not >>> use `delete-other-windows' (it shouldn't be using that anyway), but I >>> wonder if that's likely to cause an unacceptable amount of friction with >>> other packages/user code. (While noting that this behavior is off by >>> default.) >> >> You can also specify a function in the 'delete-other-windows' >> parameter of any window involved. One that dissolves atomicity, for >> example. > > Oh, excellent! I don't think I'll actually use that yet -- I'll fix my > own package not to call `delete-other-windows', then ask folks to enable > this feature and watch out for the error, and hopefully bug reports will > show how `delete-other-windows' might be being used in the wild. Then we > can look at how best to implement the d-o-w parameter for Gnus windows. There's the patch as it stands. I'll push in a bit if there's no objection. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-New-option-for-making-Gnus-window-layouts-atomic.patch >From 1ac1048dff4f2ddae5dec9eee75c0a4122c3feb8 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Sun, 21 Apr 2019 11:04:20 -0700 Subject: [PATCH] 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 ++++++++ lisp/gnus/gnus-win.el | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index fb9581f985..d535c1a49e 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -22923,6 +22923,14 @@ Window Layout 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/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el index e6906e99bb..c6a9832f30 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 t + "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,13 @@ gnus-configure-windows (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))))))))) -- 2.23.0 --=-=-=--