From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#64619: [PATCH] Add toggle-window-dedicated command Date: Mon, 21 Aug 2023 22:20:20 +0300 Message-ID: <83r0nwtd6z.fsf@gnu.org> References: <87h6ovgnpn.fsf@catern.com> <874jkvvwm2.fsf@posteo.net> <87jztr0zt7.fsf@catern.com> <87zg2nuho0.fsf@posteo.net> <877cpqreat.fsf@catern.com> <83il9axnll.fsf@gnu.org> <878ra4pn28.fsf@catern.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21705"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sbaugh@janestreet.com, philipk@posteo.net, rudalics@gmx.at, drew.adams@oracle.com, 64619@debbugs.gnu.org To: sbaugh@catern.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 21 21:21:29 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qYASv-0005To-O7 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Aug 2023 21:21:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYAST-0005Vo-Pe; Mon, 21 Aug 2023 15:21:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYASS-0005U4-77 for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 15:21:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYASR-0002A8-Tm for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 15:20:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qYAST-0003Ww-UZ for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 15:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Aug 2023 19:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64619 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64619-submit@debbugs.gnu.org id=B64619.169264565313547 (code B ref 64619); Mon, 21 Aug 2023 19:21:01 +0000 Original-Received: (at 64619) by debbugs.gnu.org; 21 Aug 2023 19:20:53 +0000 Original-Received: from localhost ([127.0.0.1]:57853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYASK-0003WR-HG for submit@debbugs.gnu.org; Mon, 21 Aug 2023 15:20:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYASH-0003WB-K4 for 64619@debbugs.gnu.org; Mon, 21 Aug 2023 15:20:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYAS7-00026h-T6; Mon, 21 Aug 2023 15:20:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=PE9Jl1zUp53Zp1NusvExTEDXCt+hzH/pgQCDQ0BMA24=; b=M2E8ZJh/U4jZ tenqEIl7AaobUhCi+05s4PdgC8m/P3lws5JwsNJrmJ3srhyHJe4+fwRfzyz4zynIoyReC3kBH5ZDk N2Hh4kRtlUrrnCE/M/BDwZY3dF6BeqFX6za9Hu7rwdPROyurwszUeXJf8ghSr3DRL0FgQK9LphizL bVe7rHCvWUDawspOtuAMtoIVXiy62hwWfxP2OXLafQ5IJZ0Ur0c3fuKFY5nK1VZ9EwHi+gWhsmd7Y PRgSr+PJ/247EhSov8sG/aliTF85IMfR0/jiDcNekUrlGzuUUI5nqv1rg6PInwCyfoiLQIT1ylaQr 3Yl+o+WyvPbCL+8qD6/56A==; In-Reply-To: <878ra4pn28.fsf@catern.com> (sbaugh@catern.com) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268122 Archived-At: > From: sbaugh@catern.com > Date: Mon, 21 Aug 2023 13:00:48 +0000 (UTC) > Cc: sbaugh@janestreet.com, philipk@posteo.net, 64619@debbugs.gnu.org, > drew.adams@oracle.com, rudalics@gmx.at > > >> @@ -675,6 +696,7 @@ mode-line-end-spaces > >> 'mode-line-modified > >> 'mode-line-remote) > >> 'display '(min-width (5.0))) > >> + 'mode-line-window-dedicated > >> 'mode-line-frame-identification > >> 'mode-line-buffer-identification > >> " " > > > > Why not add this to the group with the min-width property (and enlarge > > that to 6.0)? That way, we prevent annoying horizontal movement of > > the rest of the mode-line display when toggling the state. > > Hm, I tried doing that, but maybe I don't understand min-width, because > there's still horizontal movement of the mode-line when I toggle it on > and off. I tried various combinations of strings, but they all had this > behavior, maybe I'm doing something obviously wrong? Look at how modeline-client was fixed recently, it had the same problem. > Also, if we make it fixed-size in this way, should we display "-" > instead of nothing when the window is not dedicated? Or just an empty > space? Empty space is fine, and min-width will do that. > - @var{cs}:@var{ch}-@var{fr} @var{buf} @var{pos} @var{line} (@var{major} @var{minor}) > + @var{cs}:@var{ch}-@var{D}@var{fr} @var{buf} @var{pos} @var{line} (@var{major} @var{minor}) > @end example > > @noindent > @@ -231,6 +231,12 @@ Mode Line > However, if @code{default-directory} (@pxref{File Names}) for the > current buffer is on a remote machine, @samp{@@} is displayed instead. > > + @var{D} appears if the window is dedicated to its current buffer. This should be @var{d}, lower-case, as all the arguments of @var are. makeinfo will either up-case it (for Info) or produce a slanted typeface (for other output formats). > +@cindex dedicated window > + Sometimes, a window is ``dedicated'' to its current buffer ^ A period is missing there. > +@code{display-buffer} will avoid reusing dedicated windows most of the > +time. This is indicated by a ``d'' in the mode line (@pxref{Mode > +Line}). A window can also be strongly dedicated, which prevents any > +changes to the buffer displayed in the window this is indicated by a > +``D'' in the mode line. Why use ``d'' and ``D'' and not @samp? > +You can control the default of FLAG with > +`toggle-window-dedicated-flag'. Consequently, if you set that > +variable to t, strong dedication will be used by default. The last sentence should say at the end "...and \\[universal-argument] will make the window weakly dedicated."