From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: sbaugh@catern.com Newsgroups: gmane.emacs.bugs Subject: bug#64619: [PATCH] Add toggle-window-dedicated command Date: Sun, 20 Aug 2023 14:09:35 +0000 (UTC) Message-ID: <87fs4dpzz5.fsf@catern.com> References: <87h6ovgnpn.fsf@catern.com> <387ee04aa9601b936ac5@heytings.org> <87350ere4n.fsf@catern.com> <387ee04aa97c3477c4f3@heytings.org> <87zg2mpuv9.fsf@catern.com> <387ee04aa9572975a3cd@heytings.org> <83edjyxmuz.fsf@gnu.org> <22de08b62bd05dc884c9@heytings.org> <83wmxqw1xf.fsf@gnu.org> <22de08b62bfcc659fbd6@heytings.org> <83ttsuw0tr.fsf@gnu.org> <22de08b62b6d15a880af@heytings.org> <83sf8evx98.fsf@gnu.org> <22de08b62b4b6e98a722@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26553"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, rudalics@gmx.at, Eli Zaretskii , drew.adams@oracle.com To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 20 16:10:24 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 1qXj8J-0006iL-Gq for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Aug 2023 16:10:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qXj7y-0005wQ-GX; Sun, 20 Aug 2023 10:10:02 -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 1qXj7x-0005w9-3D for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2023 10:10:01 -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 1qXj7w-00048B-Rm for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2023 10:10:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qXj7y-00080h-3h for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2023 10:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: sbaugh@catern.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Aug 2023 14:10:02 +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.169254058430753 (code B ref 64619); Sun, 20 Aug 2023 14:10:02 +0000 Original-Received: (at 64619) by debbugs.gnu.org; 20 Aug 2023 14:09:44 +0000 Original-Received: from localhost ([127.0.0.1]:54578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXj7g-0007zx-0D for submit@debbugs.gnu.org; Sun, 20 Aug 2023 10:09:44 -0400 Original-Received: from s.wrqvtbkv.outbound-mail.sendgrid.net ([149.72.123.24]:49148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXj7e-0007zh-9M for 64619@debbugs.gnu.org; Sun, 20 Aug 2023 10:09:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=os2LnhTPVqlgJu/KxHCqVuyoucvCWVxmFE8C0V6y8xM=; b=wJbsLiFf86jntTt1SdoWAHRWAuaqWIrP44GG5k0r7nXSgfJMzg5uUo0RJtILgGJcrDxz XajQ3uGrx7wgKLhLl4tbFACr785TW6t38V9lwolhcXKigKMxSgQjlHTTI//yYPeJnn24XY cR9ZELd+PUl0VQim0bEVA49/K4hKgt17CNiTc5FD1nrCWiT7BLys6X+s2OVHhbVcztPqst 2a4OxT/uVVk8R2Tu6DqiT4UHweCR0nwwb8402F1HWqNQiAbAVS8scBa2NCTtWGir4BRYK9 yR4Tqtm5oPFeNrvoh72gfMAp9YSIlc2SuPfxdQ3uVs655HfeRTgSnpaeppIKGO6Q== Original-Received: by filterdrecv-66949dbc98-5ngqz with SMTP id filterdrecv-66949dbc98-5ngqz-1-64E21E9F-3 2023-08-20 14:09:35.109640045 +0000 UTC m=+8778581.314959821 Original-Received: from earth.catern.com (unknown) by geopod-ismtpd-22 (SG) with ESMTP id 38zmd6HSTA-cT2xIkQnKlQ Sun, 20 Aug 2023 14:09:34.991 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=heytings.org Original-Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 553E262523; Sun, 20 Aug 2023 10:09:34 -0400 (EDT) In-Reply-To: <22de08b62b4b6e98a722@heytings.org> (Gregory Heytings's message of "Sun, 20 Aug 2023 10:25:08 +0000") X-SG-EID: ZgbRq7gjGrt0q/Pjvxk7wM0yQFRdOkTJAtEbkjCkHbLnegdj3HmpExqSBZSZPWyL2AKsB1xXpC4Gnm/6wuZXpNx3535k8rg6HtAMP+nESLAwD6wC9lTSiml97uFsgIiCP4rWaiaKtaFF0BP5uhddab7WXwlxzszojoxZFpSJ/L7XJmqI7uUbZtqtpFR+nphGsEWgE6WwexJ0yNuj/SxXeQ== X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== 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:267998 Archived-At: Gregory Heytings writes: >> So I don't think this variable can serve the user preference for >> whether the window should be strongly or weekly dedicated by >> default. >> > > Agreed. > > Let's now see whether Spencer agrees that using that variable to tweak > the behavior of C-x b is enough to avoid the annoyance he experienced. I didn't know about switch-to-buffer-in-dedicated-window. It does resolve the basic annoyance I described, of C-x b not working. But, it affects all windows, not just ones that have been interactively dedicated by the user. I personally have just set switch-to-buffer-in-dedicated-window to `pop', so that C-x b works when I happen to be in a window which was made strongly dedicated by a Lisp program. But for windows which I interactively choose to dedicate with toggle-window-dedicated, I think I'd prefer the `t' behavior. Which is effectively what we have now by weakly dedicating the window. (Further in the vein of "customizing different window dedications differently", maybe toggle-window-dedicated should even have its own unique dedication symbol by default, `interactively' or something, so a user can customize the behavior of that without affecting other windows. That would mean weak dedication by default, of course.) I would be fine with a variable controlling what toggle-window-dedicated does. In the "unique dedication symbol for toggle-window-dedicated" case that variable could just hold that symbol and if people want strong dedication they can set it to `t'. --- Completely separate suggestion and possible resolution: Maybe we can have two commands, one which does weak dedication and the other strong dedication? And eventually, when we add keybindings, we could have weak bound to C-x w d and strong to C-x w D? I suggest this because the indicator I added to the mode line shows 'd' for weak dedication and 'D' for strong dedication. And while testing, I just unthinkingly tried to do strong dedication (instead of weak) by hitting C-x w D (instead of C-x w d). That is, I just assumed that the keybindings would match the mode line indicator. Which actually seems like it would be a very good idea so maybe we should do that. And if we did that, it would resolve the issue of defaults since both options would be easily accessible. And it's not too wasteful of keybinding space since we rarely bind both lowercase and uppercase keys anyway, so we probably already wouldn't use C-x w D for anything else. We wouldn't add the bindings at first though, since we should not just assume that people will start using this command. So for now this would just mean adding a second toggle-window-dedication-strong command, which people who want strong dedication can use. Gregory mentioned not liking C-x w d, so we could also change the indicator and the expected future keybinding to something other than d/D - any suggestions? Although personally I think d/D is good.