From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 14 11:39:12 2023 Received: (at submit) by debbugs.gnu.org; 14 Jul 2023 15:39:12 +0000 Received: from localhost ([127.0.0.1]:43257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKKsy-00052H-1B for submit@debbugs.gnu.org; Fri, 14 Jul 2023 11:39:12 -0400 Received: from lists.gnu.org ([2001:470:142::17]:57096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKKsw-000524-9C for submit@debbugs.gnu.org; Fri, 14 Jul 2023 11:39:10 -0400 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 1qKKsq-0002eI-Ex for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 11:39:04 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKKsn-0004jH-JO for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 11:39:04 -0400 From: Spencer Baugh To: bug-gnu-emacs@gnu.org Subject: [PATCH] Add toggle-window-dedicated command Date: Fri, 14 Jul 2023 11:38:59 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@janestreet.com; helo=mxout5.mail.janestreet.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain Tags: patch It's sometimes useful to interactively make certain windows dedicated. This allows a level of interactive control over which window display-buffer uses. * lisp/window.el (toggle-window-dedicated): Add. (window-prefix-map): Add C-x w d binding. In GNU Emacs 29.0.92 (build 5, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2023-07-10 built on igm-qws-u22796a Repository revision: dd15432ffacbeff0291381c0109f5b1245060b1d Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: CentOS Linux 7 (Core) Configured using: 'configure --config-cache --with-x-toolkit=lucid --with-gif=ifavailable' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Add-toggle-window-dedicated-command.patch >From 2e8caf7d1f0a402568fac9e8767064a452499d60 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Fri, 14 Jul 2023 11:38:24 -0400 Subject: [PATCH] Add toggle-window-dedicated command It's sometimes useful to interactively make certain windows dedicated. This allows a level of interactive control over which window display-buffer uses. * lisp/window.el (toggle-window-dedicated): Add. (window-prefix-map): Add C-x w d binding. --- lisp/window.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lisp/window.el b/lisp/window.el index d91bbabc010..f884d9aaf16 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7463,6 +7463,20 @@ display-buffer-mark-dedicated The actual non-nil value of this variable will be copied to the `window-dedicated-p' flag.") +(defun toggle-window-dedicated (&optional window interactive) + "Toggle whether WINDOW is dedicated. + +See `set-window-dedicated-p' for more details. WINDOW defaults +to the currently selected window." + (interactive "i\np") + (setq window (window-normalize-window window)) + (if (window-dedicated-p window) + (progn + (set-window-dedicated-p window nil) + (when interactive (message "Window can now be used to display other buffers"))) + (set-window-dedicated-p window 'dedicated) + (when interactive (message "Window will now display only its current buffer")))) + (defconst display-buffer--action-function-custom-type '(choice :tag "Function" (const :tag "--" ignore) ; default for insertion @@ -10746,6 +10760,7 @@ window-prefix-map "2" #'split-root-window-below "3" #'split-root-window-right "s" #'window-toggle-side-windows + "d" #'toggle-window-dedicated "^ f" #'tear-off-window "^ t" #'tab-window-detach "-" #'fit-window-to-buffer -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 14 15:43:00 2023 Received: (at 64619) by debbugs.gnu.org; 14 Jul 2023 19:43:00 +0000 Received: from localhost ([127.0.0.1]:43548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKOgt-0003DA-IU for submit@debbugs.gnu.org; Fri, 14 Jul 2023 15:43:00 -0400 Received: from mout01.posteo.de ([185.67.36.65]:41389) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKOgp-0003Cu-3g for 64619@debbugs.gnu.org; Fri, 14 Jul 2023 15:42:58 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BBD5F240027 for <64619@debbugs.gnu.org>; Fri, 14 Jul 2023 21:42:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1689363768; bh=yQScqL5/cB+ESk62YTA31aK2fj4RxnDxFsLPR27lsew=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=mJlOAkSoUUj9LCZzcv6QX+DNhuawE57I9Uuij7J+riA/IBugR+3xipfNqTx3NT35b kSjoKURNK3doaDbyFFKdYsip1eyFAAdrzgTLxor11UFjV+TFQvr5c2lkho8BdaSf3+ 3NSBwJIK03Gt4H0jbnfTD1U1C+phTa5R3lyyebZFBLnBMTGJttFmHQCMmW26oCWvuL sY9sURQFcTD3AV1N59AFgxWSSG6gMCmC/deoJnLZkYr/bKN39vf/jApB9t0P+8SZkx ZAtj9gX1WyWtWHkhHfjLDUt9y2aWN5/xbA0ycpmccRw5crztuaTit/+sGXSMVDp+Wg QVAGGGBrQXbHQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4R2hhm09Mdz6tw8; Fri, 14 Jul 2023 21:42:47 +0200 (CEST) From: Philip Kaludercic To: Spencer Baugh Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: (Spencer Baugh's message of "Fri, 14 Jul 2023 11:38:59 -0400") References: Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Date: Fri, 14 Jul 2023 19:42:47 +0000 Message-ID: <87jzv2p9e0.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Spencer Baugh writes: > Tags: patch > > > It's sometimes useful to interactively make certain windows dedicated. > This allows a level of interactive control over which window > display-buffer uses. I think this sounds interesting, I think there is a lot that can be improved when it comes to window management. > * lisp/window.el (toggle-window-dedicated): Add. > (window-prefix-map): Add C-x w d binding. > > > In GNU Emacs 29.0.92 (build 5, x86_64-pc-linux-gnu, X toolkit, cairo > version 1.15.12, Xaw scroll bars) of 2023-07-10 built on > igm-qws-u22796a > Repository revision: dd15432ffacbeff0291381c0109f5b1245060b1d > Repository branch: emacs-29 > Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 > System Description: CentOS Linux 7 (Core) > > Configured using: > 'configure --config-cache --with-x-toolkit=lucid > --with-gif=ifavailable' > >>>From 2e8caf7d1f0a402568fac9e8767064a452499d60 Mon Sep 17 00:00:00 2001 > From: Spencer Baugh > Date: Fri, 14 Jul 2023 11:38:24 -0400 > Subject: [PATCH] Add toggle-window-dedicated command > > It's sometimes useful to interactively make certain windows dedicated. > This allows a level of interactive control over which window > display-buffer uses. > > * lisp/window.el (toggle-window-dedicated): Add. > (window-prefix-map): Add C-x w d binding. > --- > lisp/window.el | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/lisp/window.el b/lisp/window.el > index d91bbabc010..f884d9aaf16 100644 > --- a/lisp/window.el > +++ b/lisp/window.el > @@ -7463,6 +7463,20 @@ display-buffer-mark-dedicated > The actual non-nil value of this variable will be copied to the > `window-dedicated-p' flag.") > > +(defun toggle-window-dedicated (&optional window interactive) > + "Toggle whether WINDOW is dedicated. > + > +See `set-window-dedicated-p' for more details. WINDOW defaults > +to the currently selected window." Shouldn't "interactive" be documented as well? > + (interactive "i\np") How about (interactive (list (window-normalize-window window) t)) > + (setq window (window-normalize-window window)) > + (if (window-dedicated-p window) > + (progn > + (set-window-dedicated-p window nil) > + (when interactive (message "Window can now be used to display other buffers"))) > + (set-window-dedicated-p window 'dedicated) > + (when interactive (message "Window will now display only its current buffer")))) > + > (defconst display-buffer--action-function-custom-type > '(choice :tag "Function" > (const :tag "--" ignore) ; default for insertion > @@ -10746,6 +10760,7 @@ window-prefix-map > "2" #'split-root-window-below > "3" #'split-root-window-right > "s" #'window-toggle-side-windows > + "d" #'toggle-window-dedicated > "^ f" #'tear-off-window > "^ t" #'tab-window-detach > "-" #'fit-window-to-buffer From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 14 17:17:27 2023 Received: (at 64619) by debbugs.gnu.org; 14 Jul 2023 21:17:27 +0000 Received: from localhost ([127.0.0.1]:43582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKQAI-0005ln-Pr for submit@debbugs.gnu.org; Fri, 14 Jul 2023 17:17:27 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:59776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKQAG-0005la-R1 for 64619@debbugs.gnu.org; Fri, 14 Jul 2023 17:17:26 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36EL4Aer004653; Fri, 14 Jul 2023 21:17:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=GIzXtXw7icHPkmKzkxqFjkwpt/GqxDjUuHb/dwz9ieQ=; b=ZRFQrXIUii5cT6IRM0oxqAtyGdBNIX60MguZa20akMtaSBuxMLrlUERyzRqfgT8H/zOM BhRqzqjcOs4gY4UZG81Kbtz8UFocfUwCpL7kZ9rH/RZT5DaAeqZDVxf0WEomstaGE4aa tmUZI65C0PUKfBdn5Z8tUr//YxLX29OyBGkUXUt13eyOkWmoggOgmKJbCVCgqXZ8+f2j mpCofMF2TAt0M2+QPFzTWQYQEs1bj7BD0yd4JYyKfJmYQ6RDFRFDSUfYY2FZUdOG+lvD aqFv78Uhfwv4lnTI3BdBp3o5YGodZu4jkAqJ+G4SNRHeXhvr2tlNEfZlaFEkbPWa5NdZ Xw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rtptn2cap-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jul 2023 21:17:22 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36EJcs97007545; Fri, 14 Jul 2023 21:17:21 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rtpvsrbmj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jul 2023 21:17:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WtOyZdwBp/eok8xzuujLsRxZyRs3qPmK9dSuMAAtK3mDi6EtCTcb72T/HBy1mi55LdUQUlWekZ2ME3B9zl2PvXVLtIHVVvWyQz9M3R6AnWpeiDcaxA026Dyrfq2dNGhNmBGYdEwWt+8F5hfYTqTUlnyVtoU5oVyVIFnWmyeF4Cq0pDoPUft+ENvHm3lhCfEG/R/ougtFE46oehs/qW4HfYkIX3iFtS8V03JdvDcOX8tlmD4nieyw3kpci5V73UVpVI498kHiOJrBQG9b4KApK+StqeYkNkCYV5Zpa3lZN2Ea8LluW5yjJlvXng0PMXrZZD2NP5RTq3y77z8aSFHN4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GIzXtXw7icHPkmKzkxqFjkwpt/GqxDjUuHb/dwz9ieQ=; b=Y1oSF87M041LLDCh5iWAdWXjThFNSarFDgRP3ZSKPI2jjYAIcQa3PwQh8uNMviF6pc2FxEmNYSaCljniT/rmJtnc+pxmwXnJmB8/UViWBBG9d+kzrlkzCXdAXgHUABz25zxVSRFOkvZ/DKv10rPGpYWMhzGp99XbNsYr7DVtmzT3Qgx9UvE12srL18dmOzKOzxQzwsV5B39A/cR2r7v7ngR9lIPUW6qbw10DCqckGOrumBmAqLKHQJKeSmYDur0ReFq2UXy6F+77wXbDr8j87S5Oh8laoN2ZmEKV1+eMYSXEvZSE1NV166VfeyHf+TmZxHWVxK09NSn4X8hn5ynADQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GIzXtXw7icHPkmKzkxqFjkwpt/GqxDjUuHb/dwz9ieQ=; b=qWceZn7vnqaOhOW/HYtdYAW4bK35Rs8xO46QtylQDN+sLmFRx4+jaoWWQdIdn3//jWwAxJavoW14HDfSh9sC3iLVFO1jcLSTkGzCLYZ/laQUgJVIKdjuo4S5OfRL5n6K8fcJPkbf92UQoHGVixH6yQF0Sulkz2a4TAfQdh2SEfc= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by PH7PR10MB6334.namprd10.prod.outlook.com (2603:10b6:510:1b1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Fri, 14 Jul 2023 21:17:18 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::ee61:7a33:13b:888d]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::ee61:7a33:13b:888d%6]) with mapi id 15.20.6588.027; Fri, 14 Jul 2023 21:17:18 +0000 From: Drew Adams To: Philip Kaludercic , Spencer Baugh Subject: RE: [External] : bug#64619: [PATCH] Add toggle-window-dedicated command Thread-Topic: [External] : bug#64619: [PATCH] Add toggle-window-dedicated command Thread-Index: AQHZtouAAI6AYB2XNEOqIEZPsKmQda+5ubMg Date: Fri, 14 Jul 2023 21:17:18 +0000 Message-ID: References: <87jzv2p9e0.fsf@posteo.net> In-Reply-To: <87jzv2p9e0.fsf@posteo.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|PH7PR10MB6334:EE_ x-ms-office365-filtering-correlation-id: 6a3668cd-3f41-45f1-0b22-08db84afb468 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mcx2D4nOnQEZvBGZAy/t2XHoL9RpwCJ4TxbWwQw0/SxP3poq5uVDqiZXbQwVvATMQ+L5IJxh/8sHkp01mp41gqqN8DlsU9DoiGXSOJNkTIIdaJ98gR7W0mjoogVgA5/y2UE67ytYVNfU5kXFSh5yyXXg5ARgJaUyQ8ndoiZ1mg7y+D/jW6TNY3eniK1ysM2VWBJQo/XdpguUv/lr9qhT77f/u9JTLRNCH672vF76Q/4IRYZLJTV1y+Dqj3iGq4++IMUELAQfSlg3BYbyf0SC12pKz+IowXoVDUHw8YxH2sZPgeh+6N2kr9LW73c+vJhEzbpMZg5qMfXDaIroOemscTrkJ0unKUJHv0GSmRE42fyuar+yv/o4vy4UBgsQtRzffD8AojxgLltaEJ9LsNInSi6tjnHozh/t2bJIdTxBt8KXwEkdICCKrN+A+CJPK5WCJrxSipFWptFZnezY3pUldtUYWU7EOnPpGEfZXl2K/91bBBrQZw9wH0AqiANtOPrbRugakf/fIl/+NN/6Fx3FYdxdkqqdHJ5WTlQ3Gmh/iNM0jr+wXRgEwoUVuDzhOfgZlxgiYPQ3sFKbpClzreow8rO0XJ3eKfzevF7zC91qPjk2poT80pjbtRCDIi+uSWSg x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(376002)(396003)(366004)(346002)(39860400002)(136003)(451199021)(52536014)(5660300002)(44832011)(38100700002)(41300700001)(122000001)(8936002)(8676002)(316002)(38070700005)(55016003)(86362001)(2906002)(26005)(6506007)(9686003)(71200400001)(7696005)(478600001)(83380400001)(33656002)(186003)(110136005)(4326008)(76116006)(64756008)(66446008)(66476007)(66556008)(66946007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?5RvugSJhtyDiEEof8kj1RX74IEFqj5D2FOA3Gk3LE1wP6gDNudlJa3RbLBB3?= =?us-ascii?Q?FzgKXcCpnybYvr3Mg484PTtvu1dra+c252Am6jO/TwJ6AvuhGetQriPvVdbZ?= =?us-ascii?Q?2ry9fhdObFSGd72zGqvrDY6Si/lernB+kCz6yCvIoHA+KiU4d1fzPEcAEQLL?= =?us-ascii?Q?oC2C5TMEH9HlE+DOXjUdFzTcNnrjaa0wa+X6dhclxu6VUghFfAi+5uyQ7dAB?= =?us-ascii?Q?HoujowhjA4lygW4DGgiO1F04KZLh/tjI7EK8NfV8t9mjbYZfEy/699Bc4DDz?= =?us-ascii?Q?C2nvWxP0k8Rrgpo2+/9XIw9MQHAWO8xnENc9FFgJMdSUHHPEFn2PD9zkf85c?= =?us-ascii?Q?1/w0pIWCnMTZ1xRmnXOd3UadJfireFLXqoem7uFBZRIaBiORTV7UM9D8+ppA?= =?us-ascii?Q?B6SzfUpr5xEJ5kreWNSwk3QIWhgMCpseKDwRVuh3hLBT5zLMN4cjUHC/Ex7U?= =?us-ascii?Q?FP8347LzyY4s/XHBKUdVsAOeOxQMSTD5cPiMmwmMnKUEAx6bmEmLuUZ4DVjO?= =?us-ascii?Q?YRQd96kGZhqhDZraoERbrLoLal9oEjjRR/dsfVpyoGlM27S14XGMShvPfzJQ?= =?us-ascii?Q?vi7qsAT4/GL3ZXDvwvUf8dAK+3TX+OwDOAiiRgijOcSt4aSGVbdc2KLJDv13?= =?us-ascii?Q?8IbyWT60fjl7YNnQqDgz81YqnR1QSr3xGNjvGiGPZpLHPZThK7aqqHe6AI3q?= =?us-ascii?Q?cpRmOpH2VQXd5PHTsavuAx4O/Q1VLQ27dGeGQU91Y6NASxatvzFRC8qQ5TKI?= =?us-ascii?Q?1buvRE1CX20TDR6e3g2jCDfw0E147VtBe/VgR/fL7g+ABIc3KhVCocim3nMj?= =?us-ascii?Q?5cAAI78/vjf02junkbAbzk7WJBjvdI3B4W1h/2QeSJwbLvBvYLRcVNJF6Hxb?= =?us-ascii?Q?2AfTfDB1jtm9JbHQYrgc6Ukw4C+XyPf86V3dUagtXQKSEM+Dm2LqnT19OpNC?= =?us-ascii?Q?3xgz7q/rHKlNxML3Zk48s/ueHOr33g7H1aazNgp22bLF2X3APkmor5SwBHje?= =?us-ascii?Q?gl/7gjZKt98ZnSOxTOuX7yT+J9qmX6M/jzRSuXH8G9jWC4gaEx2SpUDF2byn?= =?us-ascii?Q?GnBYRqZl6GW3i34mi0EGQJtMSL6IxnD5zmcywi3k+oh7HZdXLFcU2X02RXdb?= =?us-ascii?Q?eyJVP7NYEz0nf0Z95mmoU+7Du5h7XRoCCEaqCL/32/ZdBOL9ps/X9WjzcNkm?= =?us-ascii?Q?NYJjSRVh4LNK5RM2QZA6vUyaQbsdKzfeT6f1isMwndQ0hR78C+xc1uj+tAxK?= =?us-ascii?Q?yh9dN0yRdRgIKB9R2j8A3O/6SJiuHgVZfYyQz5axqYdTimoiJXUtXrdpojcZ?= =?us-ascii?Q?RK/1nAGD9gY1+jmSHG+TUfyh/DLCzPvQJdT9VPK2enYOMrnEnxc/DsfmOYOP?= =?us-ascii?Q?WhV6R6nvLuTZK4DQEVDS8qYltvtZdHGhEHBTU4vKwQZce3o0FAhXidesgiZd?= =?us-ascii?Q?pyI0D7/kkJ+vxozqCmQkAo4xwGjE51G2p9KoOaBNcH4GXWd3VvIl23Qs2uux?= =?us-ascii?Q?DBA8Wehxlbva7GLh/xHPEYb05NwVWIF0t8hrt6aMaSkajLUwoM1FAFaNPe2Y?= =?us-ascii?Q?hK2bjitA/LBCxx7UK6LMPE7741Xq6lhkFGWL2fGi?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ik0e0gYXqMrUXwtntUcH8yItR/Cxo2dT9L7sFpBnBnt8O7poKJ+sC6TLjpsdMrrhW3XSeoXQZw+L14hE2s08dRaDNkD5rp6XoiFc+VfX4PDnMnSVBGEKfIutJKyY+0D60NBPMl5/OPXdDZ/K268E+H0LWylH+1+H9H0kHVm+pe1/7T9yRcYLkB7cUjBTmno9xG1czCBHRdfIUEVORoB3fTjeWGN63Jl77d1pLV1SvSudopmCNhnU6JBXUmeo1OrJTclJjThHBmXAsm+jY/6Xed72Mn78bFeZ6g4pF8VIFRuSEBB/Mca9WKthRqYVQzTWV1UdOtEj95diSvmAWYsr5FhQqMKi6H5Idpsa3nLiI9hNncVxeaT2XJlPLIqPWNLhRfAQoTaoun5WAwcmTOsEZCoPNwAf99HvsG5aHh+j878XnDYhlmbafGWA5SoPldarQ67BVTcQUReV6QhYk1oCw00kL3e08qv+qoi8Rz2WjhBAAWeZnA0oRiQNRXDt8HYxumgZLzc02/2y3J+KsZvru8z1EJ6qxsdIIddFgeByHCOtQ1SFG6I+G+x3w4j/+qFUsMCVFpf0hcP0afCWo1l5egJdtKVeGn75N2SZo1aAectLH41oh+lmcRgeycbL1sTDzDllWp+RCmjDNUZPnBE4pQDtRct783N9NftgsJst2kJeMc+hUxIVxU26DaeRoTroYk4ERDrEXdTO4YV6tLn8s1AujW5bbXjFQBmURDTKXyJgtMk2BrFrtK0N1cnZuwXcQcIwUpIZYJuBidkVOHu0LjNkuOPcD3uW5jAiymtbz1TvcbncmTNhIlDs11WGmJcJvc1i2v7vV8kgv50pVyZ8ag== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a3668cd-3f41-45f1-0b22-08db84afb468 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jul 2023 21:17:18.3558 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Gh84a+l/HIz8H8tSXTtjH+GrASzE5EZ/ibgjLM5jvviBqhkj1k+OMsd77WIMB6lj6MQZgWQtRCLhhxtnyQCfYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6334 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-14_10,2023-07-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 mlxlogscore=719 spamscore=0 phishscore=0 mlxscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307140195 X-Proofpoint-ORIG-GUID: jfUQc4viSeoESP54hFjSVqsmQuxRGiCN X-Proofpoint-GUID: jfUQc4viSeoESP54hFjSVqsmQuxRGiCN X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 64619 Cc: "64619@debbugs.gnu.org" <64619@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Some minor comments. > + (if (window-dedicated-p window) > + (progn > + (set-window-dedicated-p window nil) > + (when interactive (message "Window can now be used to display ot= her buffers"))) > + (set-window-dedicated-p window 'dedicated) > + (when interactive (message "Window will now display only its current= buffer")))) 1. Why _weakly_ dedicated? 2. Why not just this? (let ((before (window-dedicated-p window))) (set-window-dedicated-p window (not before)) (when interactive (message "Window is %s dedicated to buffer %s" (if before "no longer" "now") (current-buffer)))) If someone might not know what it means for a window to be dedicated, put that info in the doc string, not in the message. 3. The toggle, as OP proposed it, imposes weak dedication, and the toggle as I wrote it above imposes strong dedication. What if you want a toggle that respects whatever non-nil FLAG (weak or strong) might have already been used for the window? IOW, what if the window is dedicated to start with, before you first use the toggle, and you want to get back that same dedicated behavior (weak or strong) when you toggle it back again? The toggle (either definition) doesn't do that. Shouldn't the doc make clear that the toggling behavior is always between weak & undedicated (OP version) or always between strong & undedicated (my version, above)? IOW, let a user know that any original dedicated behavior is lost, once you use the toggle. Or if you want to let a user specify whether to use weak or strong, maybe do that with a prefix arg? =20 From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 14 19:58:47 2023 Received: (at 64619) by debbugs.gnu.org; 14 Jul 2023 23:58:47 +0000 Received: from localhost ([127.0.0.1]:43653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKSgQ-0002Ad-Oj for submit@debbugs.gnu.org; Fri, 14 Jul 2023 19:58:47 -0400 Received: from s.wrqvwxzv.outbound-mail.sendgrid.net ([149.72.154.232]:32512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKSgO-0002AH-5y for 64619@debbugs.gnu.org; Fri, 14 Jul 2023 19:58:45 -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=D59AkhxIJnXY60LGHwl04+mogHFuthseeqLvxKGmFJU=; b=EJcA3GIgikHGIeuRvLDuJ6EF01y6mtsztRnx7zx/uSIEWdZruE4JiKTUpP5Jxo36s4eu lkdYzUY/g9VPAJsvNS2zT+jkPvkjMARzFPrLS0HncWWO/FU9Sk19a8jkIpUm0bp8kjyRXt iNhL7Qpavywm6huFC3tqX2+MTm0nwvF/wqmVyLaMW9TZxwpQ1hAhZqBFNY9B026+zHH3RJ jusXOJgJjzraH2ACGzB6ecece2Wmta2ye/7BoEkX8asb/xCCMEeVyrIl821CfzXaMEv/nl CjvpU+J8LIOZGKhvE21lPfBf2NuB2oEN6ME6FWmT8EhcnuZKHTXuXaVW7lzHZ90A== Received: by filterdrecv-65f68489c8-xfp5j with SMTP id filterdrecv-65f68489c8-xfp5j-1-64B1E12E-10 2023-07-14 23:58:38.184149357 +0000 UTC m=+5617356.790099461 Received: from earth.catern.com (unknown) by geopod-ismtpd-39 (SG) with ESMTP id KahIYBqVSSiCwaGGX6_ZTw Fri, 14 Jul 2023 23:58:38.114 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=oracle.com Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 67C716015A; Fri, 14 Jul 2023 19:58:37 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: (Drew Adams's message of "Fri, 14 Jul 2023 21:17:18 +0000") References: <87jzv2p9e0.fsf@posteo.net> Date: Fri, 14 Jul 2023 23:58:38 +0000 (UTC) Message-ID: <87zg3yhwpe.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbLhDeYyk111yqx5sKsMgT?= =?us-ascii?Q?2Dk5Ac0O6LZfLp4x7UzeEcL2gUl7rmfpDN+XCCM?= =?us-ascii?Q?IBnF9unQ=2FEZxxu8bHjUrWnOuQE2xSM1WBkDrzfz?= =?us-ascii?Q?qzqDXER30fqv52diTSfG8ZbsRA6aN1Hui7=2FlcGv?= =?us-ascii?Q?JLG1P27Vh=2FD7R5lQlk3G7kuyKxXmUHcmYiw=3D=3D?= To: Drew Adams X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Drew Adams writes: > Some minor comments. > >> + (if (window-dedicated-p window) >> + (progn >> + (set-window-dedicated-p window nil) >> + (when interactive (message "Window can now be used to display other buffers"))) [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [149.72.154.232 listed in wl.mailspike.net] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 64619 Cc: Spencer Baugh , Philip Kaludercic , "64619@debbugs.gnu.org" <64619@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) Drew Adams writes: > Some minor comments. > >> + (if (window-dedicated-p window) >> + (progn >> + (set-window-dedicated-p window nil) >> + (when interactive (message "Window can now be used to display other buffers"))) >> + (set-window-dedicated-p window 'dedicated) >> + (when interactive (message "Window will now display only its current buffer")))) > > 1. Why _weakly_ dedicated? AFAIK, the difference is that if you explicitly try to switch buffer with e.g. C-x b, you succeed when the dedication is weak, and fail with an error when the dedication is strong. I find that if I explicitly hit C-x b, I want to actually switch buffers in the current window, I never want the switch to fail. Making it fail seems useful for Lisp programs, sometimes, but not so much interactive usage. > 2. Why not just this? > > (let ((before (window-dedicated-p window))) > (set-window-dedicated-p window (not before)) > (when interactive > (message "Window is %s dedicated to buffer %s" > (if before "no longer" "now") > (current-buffer)))) > > If someone might not know what it means for a > window to be dedicated, put that info in the > doc string, not in the message. Will do. > 3. The toggle, as OP proposed it, imposes weak > dedication, and the toggle as I wrote it above > imposes strong dedication. What if you want > a toggle that respects whatever non-nil FLAG > (weak or strong) might have already been used > for the window? > > IOW, what if the window is dedicated to start > with, before you first use the toggle, and you > want to get back that same dedicated behavior > (weak or strong) when you toggle it back again? > The toggle (either definition) doesn't do that. That would be nice, but I don't see a way to do it. At the same time, I think it's probably fine for the user to explicitly choose whether they want it to be weak or strong. After all, this way it allows the user to change the dedicated mode. > Shouldn't the doc make clear that the toggling > behavior is always between weak & undedicated > (OP version) or always between strong & > undedicated (my version, above)? IOW, let a > user know that any original dedicated behavior > is lost, once you use the toggle. > > Or if you want to let a user specify whether > to use weak or strong, maybe do that with a > prefix arg? Good point, I'll add a prefix arg for strong dedication. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 15 01:44:01 2023 Received: (at 64619) by debbugs.gnu.org; 15 Jul 2023 05:44:01 +0000 Received: from localhost ([127.0.0.1]:43818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKY4W-0003eG-MX for submit@debbugs.gnu.org; Sat, 15 Jul 2023 01:44:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKY4U-0003e1-Ad for 64619@debbugs.gnu.org; Sat, 15 Jul 2023 01:43:59 -0400 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 1qKY4O-0004Ty-MH; Sat, 15 Jul 2023 01:43:52 -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=cj/HYrYiLtaoTuFWuYjFKmtIwb5YELjFFR1w9Nknrv0=; b=SfKBkv07jrou PI7hAmptT8bLBPHf7LuUIPayYvBqvCrwfStYWbXl9KZGj3aorISzgQkyqpJBFX7SuN73etO1J/giX +nJAL/wpLHHi7o5VnOakviqNt7hrKvAqYMBJ8R7Y9aVCzV217IQOKRk04idqP+bigWXjpZ214brSv 3W3qBfSCFJ8EiGxV1opvn8AurNMwzIUb2edVXaf972SeCGM6QffiNJrEW6AzEMWR2DlLeNbIZHZuP dqaOUO6Faj/XWwfxGtEPnrydC0CUVrg4SHM8HdoZyDD64uZrueWr8bxgq0YUXDRqlDy77HUUDbNd3 t61H5GYtNMX27ItG9/xNgg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKY4N-0007ts-W7; Sat, 15 Jul 2023 01:43:52 -0400 Date: Sat, 15 Jul 2023 08:44:13 +0300 Message-Id: <83o7kdenki.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh , martin rudalics In-Reply-To: (message from Spencer Baugh on Fri, 14 Jul 2023 11:38:59 -0400) Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Spencer Baugh > Date: Fri, 14 Jul 2023 11:38:59 -0400 > > It's sometimes useful to interactively make certain windows dedicated. > This allows a level of interactive control over which window > display-buffer uses. > > * lisp/window.el (toggle-window-dedicated): Add. > (window-prefix-map): Add C-x w d binding. Adding Martin. Martin, any comments? From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 15 03:54:01 2023 Received: (at 64619) by debbugs.gnu.org; 15 Jul 2023 07:54:01 +0000 Received: from localhost ([127.0.0.1]:44026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKa6L-0001h7-AY for submit@debbugs.gnu.org; Sat, 15 Jul 2023 03:54:01 -0400 Received: from mout.gmx.net ([212.227.15.15]:42403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKa6J-0001gt-50 for 64619@debbugs.gnu.org; Sat, 15 Jul 2023 03:53:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417; t=1689407630; x=1690012430; i=rudalics@gmx.at; bh=ADZB5m6JFQY0mYPU7ou9l9g1jDZ7/OCmtG3983sDzs4=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=XH5F9OmBOUgprH8Yw50rSRq7IbO30OwZbT3KlEbBLaj1XplpSQr7keks2hpDevEniY24e2A gmPEGsFl37N5lB18lNWwv3xz8K9W98bInTB6mw5OL3wz9/3RlForp9H6V07IxBP6bPR8PzOda h8Qn8VKSZK+WRfQhaQQ1ZVf0wxasWBmI7G0WVAPM8wNAwRv4fFUoanX8jiU4KqWukMkvmijf2 cqjYR/Kl9TkmdhVMbR9kW3iIicLw1iT0njcwKeotz+OVM0ckRsKsHyqbQokch3Ob7mWFphQce 5UVrZDWrexkybEFczObM+2MaDTpvMtq5KXw1Rthai5gLS6Da+TCg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.1.102] ([46.125.249.61]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MjS5A-1pePrQ1UoU-00l0RU; Sat, 15 Jul 2023 09:53:50 +0200 Message-ID: <580a66c1-7496-7f05-e58e-5e9361094aee@gmx.at> Date: Sat, 15 Jul 2023 09:53:47 +0200 MIME-Version: 1.0 Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command Content-Language: en-US To: Eli Zaretskii , Spencer Baugh References: <83o7kdenki.fsf@gnu.org> From: martin rudalics In-Reply-To: <83o7kdenki.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:lKW+WvXytce4S9SmTtD4qAYv8s1TDjFLTu/qfdIjVopo5BmuclZ BSuLLCNwg8kwempTjFfMmaF70nh5j9jiMSIQAuZfLWHJtHOfsUrpoDXRUFnEow+3i99+YHH jhO4td+phkWToUw1Gys+km/tmzaZs45JzFaD9JmrVFRJl29HF+LCGRdKl5gTGXQmlXmuJRx ILxcMJ6xiTbViiZfGLnvg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:DhtmTCczXJs=;glMkFobXvvkQSSnSpvxYeUwNvNv 1qvEgcY48iEL+qTLzwzqTlTlS4LS9yeD0erKoBIkbQK7a20w3bjLfbGQVl3/nxGD8TVXR35VB YsrO86zXkY/xuH50bJBjvl8bPzUghIOKo21TF7qQ8jsdOWG3wPheITKaf10vw6ljLNXdNI/cT JdFqNfwjKZAUAjL81JtMW2Q0M/Jh6Dy1PZosZNT5+qY+4aM2k1xrzygOVKUTgt+xQZ7J3XPMc yhR0nTnm4ZO81BqHXmG+a7bX+AquJAmeAtjoIGAtaeG5HkTVCPxblQn5089IvlJ9fHMS5JX+K BLlF5SCAQp8315hRLawkDysJO1UylihpPpbdz3Cr+bgfdPEsmAcEf4NoaTY75XfRhvsgyHzv+ qu/e0RPt3fXHs7ar/gWNAoiJtgyB89FXIEuw427xAKJwGz1iiUjiHVR2PdaUGoo5ld530TdMa g3tgud0RWHQA39kgJ6V1MidG2zCefykqvJvTjGgRV4w242uNF1g1LR9ReOqXILD85+JTB/LN+ PtbJy3FOVPa5HAQmjA8mPdsEYK580A7Hkn1VzsDA+KxRC1H9JVcgUfxgWmDyfjYxSNYW80NKB Dc8VxHXhQF/83QsofemzfsdeFsv6uYTb4sAfxFrhZr9vR2y4HxJ+73exyMwFb0J2fb+FRM2Re /95Xra6gJTHDtn4k5OShCo0C5c3pJ56ou5zdjmkh1daIORCl5a3xrGeE4BRKnMPv3pe6O1HKe 6kgvgU2KyaQ4fKGRfk7GQbbgUBXSPHErtJunhi4oSD5a3dWdhZcpW6pZSlL/fksHQrUZTWVjy /x1kKwdoYHqnFjqV3+GDtBDcDyWD0AfyIm3jmkVbRqoxjvNkfLJ3HkYQfoMyGZVk0apAAc/cm Oi0mh9l9gzYV3s0olTI7qF0PElq28vgrr9KFHhv0vgKxTNNSgmIhCiWB5IkZXXinnzBMDEZ7p pwy9avZxKP5Bs3zbK605/oOh8q8= X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) >> * lisp/window.el (toggle-window-dedicated): Add. >> (window-prefix-map): Add C-x w d binding. > > Adding Martin. Martin, any comments? It should hardly harm anyone. But what would be a typical scenario for using it? C-x b has 'switch-to-buffer-in-dedicated-window', C-x and friends probably should do the same. Usually a window is marked as dedicated to avoid that 'display-buffer' uses it. In which case it would likely be better to not mark the window as dedicated in the first place - e.g. via a (dedicated . nil) entry in `display-buffer-alist'. martin From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 15 13:41:45 2023 Received: (at 64619) by debbugs.gnu.org; 15 Jul 2023 17:41:45 +0000 Received: from localhost ([127.0.0.1]:46023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKjH6-00070b-VB for submit@debbugs.gnu.org; Sat, 15 Jul 2023 13:41:45 -0400 Received: from s.wrqvtzvf.outbound-mail.sendgrid.net ([149.72.126.143]:35202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKjH4-00070J-IH for 64619@debbugs.gnu.org; Sat, 15 Jul 2023 13:41:43 -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=MXlLZGboLGUpQ9NomlTJLXSambK95AXf7lLwYaiX7TM=; b=NNBeH3Gacj6DnIu3UEy6Px6zsex6I2WOjVT9gbHjGZets+/HoTYXKpx8xd+hwt7gsiTM WcVrgFyanm7fHavzEqm/Bp6nXsxwznJFTK46daD4B9zBPk1puYLGH/qWTsFx5Vmi7qWxH0 iK2sMZV19yHd8KvokshKmk/cvsqdJvQ7oPVIHPBX/71uUmL21xuBuOLEF3yhf4QaReWGke HMBIWrVkYN62+dej1UwIhBl5CaObn1y5y/ZRnNUTpGRxgLxcErsDB95fUIReCXpafi/6ap dp6GLzOWz4uZCa9UyJhz6r8PVCw+LpU79uB4BYvb17Esmmzdj6m0W7elDUtVUBhw== Received: by filterdrecv-77869f68cc-l7kjz with SMTP id filterdrecv-77869f68cc-l7kjz-1-64B2DA50-2C 2023-07-15 17:41:36.963647549 +0000 UTC m=+5681140.048108931 Received: from earth.catern.com (unknown) by geopod-ismtpd-37 (SG) with ESMTP id zX0f1UZ6RaigJ2FhxA7lyA Sat, 15 Jul 2023 17:41:36.889 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gmx.at Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 8E4816256B; Sat, 15 Jul 2023 13:41:36 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <580a66c1-7496-7f05-e58e-5e9361094aee@gmx.at> (martin rudalics's message of "Sat, 15 Jul 2023 09:53:47 +0200") References: <83o7kdenki.fsf@gnu.org> <580a66c1-7496-7f05-e58e-5e9361094aee@gmx.at> Date: Sat, 15 Jul 2023 17:41:36 +0000 (UTC) Message-ID: <87ttu5hy27.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbKR++M17DVwFFb6dU+xhg?= =?us-ascii?Q?f=2FVWpPuqQY=2F7bY=2FtSzHAXE=2F1mAqE4=2FkTcd3Ns7v?= =?us-ascii?Q?UfgkZ6QcuaKiI=2Fw7r26dBc5cjS3zC+aRydt+EMB?= =?us-ascii?Q?VZK+oLCb4EA4+zc0=2Fi2CWbIxegwwvuDAnXu1RCl?= =?us-ascii?Q?u3L=2Ftz9GfchfbwjJ4iR9c0VtzBOufq97SPA=3D=3D?= To: martin rudalics X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: Spencer Baugh , Eli Zaretskii , 64619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) martin rudalics writes: >>> * lisp/window.el (toggle-window-dedicated): Add. >>> (window-prefix-map): Add C-x w d binding. >> >> Adding Martin. Martin, any comments? > > It should hardly harm anyone. But what would be a typical scenario for > using it? When a window is not dedicated and one wants to make it dedicated, to affect display-buffer. > C-x b has 'switch-to-buffer-in-dedicated-window', C-x and > friends probably should do the same. Usually a window is marked as > dedicated to avoid that 'display-buffer' uses it. Exactly. > In which case it would likely be better to not mark the window as > dedicated in the first place - e.g. via a (dedicated . nil) entry in > `display-buffer-alist'. Yes, this is about making windows dedicated, not making them not dedicated. I implemented it as a toggle only because that seems nicer to a user who might otherwise make a window dedicated on accident and not know how to undo it. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 15 14:16:23 2023 Received: (at 64619) by debbugs.gnu.org; 15 Jul 2023 18:16:23 +0000 Received: from localhost ([127.0.0.1]:46068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKjod-00081M-F2 for submit@debbugs.gnu.org; Sat, 15 Jul 2023 14:16:23 -0400 Received: from mout.gmx.net ([212.227.17.21]:40479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKjoY-000813-NW for 64619@debbugs.gnu.org; Sat, 15 Jul 2023 14:16:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417; t=1689444968; x=1690049768; i=rudalics@gmx.at; bh=38Uki8XN/e3tcEQOyGB03c/mWZwaL3/t9tGyZfIxrIU=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=OzsDzV0jfJzV0g/xKGzKRIs/KSBenYncV6a89wQKQWz34sJJOgiRmvq0c4CQAakPwEMaMtv rD/6onS+A+r3YxCBLT8iBTtCrq6z1osXhq+pT+k5GFoDuclFu0nuqjNcKlM9lb0ZLrU/hs3WR BSNEgc96dFmOXi3jy1OVG20+xgdoCeDgjyxKsq2s7PRSVKK50WBLtx7OQATbM6MFPHLvTWa9V mpoecOy2XtrReMH9nFBZ4S/U6C+uD6zgb11aqF8r4oLA9oYQj968K/pDDhNGDPqUJhZumKl28 R5ikhRJwwk4cX4Z+qavgnYCd7x0TBFHC/Jr/ZNpWcFRAZh+e+kYA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.1.102] ([46.125.249.61]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MzhnN-1pypJZ2k8v-00vcYt; Sat, 15 Jul 2023 20:16:08 +0200 Message-ID: <7fa045fd-88ec-c2a0-23e1-a74d4da61f97@gmx.at> Date: Sat, 15 Jul 2023 20:16:06 +0200 MIME-Version: 1.0 Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command Content-Language: en-US To: sbaugh@catern.com References: <83o7kdenki.fsf@gnu.org> <580a66c1-7496-7f05-e58e-5e9361094aee@gmx.at> <87ttu5hy27.fsf@catern.com> From: martin rudalics In-Reply-To: <87ttu5hy27.fsf@catern.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:ClsukrpKrr1arQaHWrjAvsqebHbvvWt6aOgBTtlIl7i4NQBs9hm 3EvElCkxm/JdO+yIjKSGLm+Ps42JPz0P8gfrnjJNMLEwGeOKOftH+oB0IEZRn79WTfGt04K uEZq3E4v1C2YJLFiYyopRlX07WeIVL71Oz8dcKz0DMWtIZIDpo/dD43uYiHfbRPG77n00A4 0WIrqlCB8w4I5sF8dc51w== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:AXIxPKkhk90=;b7YTaZVzYe/8Ls50sDawa8BHJop 3TQuJMAEP5LRo4k4m8MLm81No4suQjkfw9bePkOQxEfd/xRfxJSRnk6yvICdmGBdJCxhx4zxI T5eD8Y3hiGogIzQxLOPUihF/Fxlv2Fw4WHR8oFKEsCTSOKusofHYRMPJq4fALxtqZpmJKrYi5 ii8lIoiuOzGcJqpniIeChIQA5GR5KYS30CBAWgP0BJbFvdR0C7dBQY0uBE4AFty/n0P2qAeQM A214QczspZAeBLZ04pStWBavZ9sLA9+uv/toDsXXCqQPBdm24iEsuY7LFTvQgSKs2CXNfbsND Mr0L5PWMYwDkp8n001hQf0Boy6lxMr8A00HNvzUu+QpXxwNcMrh4/1DUwZe+go0p+kd3C0MyU 9iia2tn6f92kAHkSwoR+EWPlS6qsz6fgP5HPF4Qof+CkSbxqifsYCFmA6yHS30LUnvkSd2T8M 2NIOsPW99kx+bWBZv6TLb7UrKIYIB2KA31kK+wZlhv/0fXW+88J6Jrji5T5vf5GCQlBXbQtKQ k8ulGKh8qyqNjbgu/AhpgimyjHO0TndLC42T8ionB43Rzi7rB8A+J52dk6g/l4zGMC4GcRUNO xf/clmWkPLDKj2ikUS+q7vKqqpMaDceWcEtyN0/gs0VobFN7vEQKactg7Knw3APO8smy1VYlL zXALulWWm+klLfEVJTDQYCyEj6VP7BBZqrNrezu3jzO/H6OBu8GL3zvAkZH+nBsx5NPfKPqg7 JR04QFqZRyz4uC5yQU7ARwv11gLvvm8b9qL3QoLnE4cpT9oE4iDdeMBpPsNclggNtBnkHkRrO Jzcxj+YkMtozBC9XJErnLBKL3ebi9uozt6ksaa0O91xMcM3vvz42ZUiRS/nYor54J9bRbGnio gYaZZbD1Vo/XIRnnLmXUlx8EqUyzlpuw2Hfm//Haw49c//yMzx+/ON2EUJMpxj9ivrBJjEzMB c/Uznw== X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 64619 Cc: Spencer Baugh , Eli Zaretskii , 64619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) > Yes, this is about making windows dedicated, not making them not > dedicated. I implemented it as a toggle only because that seems nicer > to a user who might otherwise make a window dedicated on accident and > not know how to undo it. But how would our user know which of his windows are dedicated? 'display-buffer' won't tell because it silently ignores them. martin From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 15 17:30:27 2023 Received: (at 64619) by debbugs.gnu.org; 15 Jul 2023 21:30:27 +0000 Received: from localhost ([127.0.0.1]:46208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKmqQ-0005zJ-Tv for submit@debbugs.gnu.org; Sat, 15 Jul 2023 17:30:27 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:7286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKmqN-0005np-Dl for 64619@debbugs.gnu.org; Sat, 15 Jul 2023 17:30:25 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36FLS9JJ017858; Sat, 15 Jul 2023 21:30:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=i/aq+BY+scxlDO7xvWeA0w6jJ08+tSzN5O91J+wUYRU=; b=qz40RO65E4uVlM792ROpyys1Eilfaz2ieQcXHPbEGXrBBAIMxkVQh3/NcFo7HNdr8tHv RIvZ8MVCkEYPdRKfZNA38W0/1uQBIkirsEj0PL9w+bwN2bl4G4gzJA6UgM8msewsqZkf +9P0+gPINXDq26OQoAv0/i00nTjhvMnC6+P+8OIBQN4Vm3uDW+DNu7OmYbJTOH6ALpHp mC/5T+lQg4paM6FSV9NEFyCdaahgY8plbbjxbnolCSLpKo8Cj9ANoBtiGjgcBuuek59G Nx2rIXoqMtahQta+WL9RKzcaVcAVMSZc5XcOvAbJRiAIrSbjgVNMDr7XGeI39xKccrcu 5Q== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3run88gq82-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 15 Jul 2023 21:30:21 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36FJ7jix038163; Sat, 15 Jul 2023 21:30:20 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2041.outbound.protection.outlook.com [104.47.51.41]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ruhw1uedw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 15 Jul 2023 21:30:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UluFgmILY7bEY74Rv+ouLAzjFLo3Ty0neakJTUk22GWGmc1kBzlO4lHN5+0RQ2kO+Sdyrl7v4lmO7W/PTFhXgr73NGrcfIkTBD+xZG6LYIKBqqGwOu6W1gEhQ8OWo6j7UWukW7AJgEBwBeR6y3ziGgPIQLDfweZHvcriB8OstsbWXgDmx2+iun2LYnqWhLcSt7sU2Snocdi0Ilrp0KX0jr6yUveOencqz3N8iztgFk4gb12RZG6Ec4iE7snrXRsfZBPTk36gky5570zcFc3rI7MwNi8Uoit4pYndgL070vDH4UMnPR4lCWrWlNW1Z269lP6ofPSwnb0ERrMfAXASZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=i/aq+BY+scxlDO7xvWeA0w6jJ08+tSzN5O91J+wUYRU=; b=NZGRChxpJLsZWg/KH5mbUwK9V6ocUYOyJHSlntitKILhT3Q4cttrkXiK1Aoh34YjCSvx9h1R8WQdDJe5bD/DZBBAtQS5VdqtNxjCEyhl9OjB8Gkzqhc/VwHzKYRZBRJnWKmc4vI2KPYbrA7mOF+4FvUfDpdBWs8Bhp8die8Falj0zvoCEggC02VV0LVinbHEH/5Kin4TuvsdlobzQUt4eBkR1om+/c04sIMFjpK1AyTy8j+0lAHNDqTCHxawhOn9f4442waV+oQH/tWx0zpzZUeJ4AJOvjn9L8S7TOAKd+uLwNzxkLYJA28gqW1R37ia1SyPzl1q+Ce/09McfH5Shw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=i/aq+BY+scxlDO7xvWeA0w6jJ08+tSzN5O91J+wUYRU=; b=bH2FDioqKkVAsB4ePePb/CD/gGgQR7dxyEmKU1bdIZLnvTKTB/6wv0Gf/2T+etR3mdqKmZBEUrboyBWYAynIX93Q9jscbrakRNm9Ga6Bp9kybL/a2AdbHSDHrlyHu/ZwR/wOoq77t9SzHnmeB23PWbt1am+nvDRubh9rgfk8Nk8= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by PH7PR10MB6481.namprd10.prod.outlook.com (2603:10b6:510:1ec::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Sat, 15 Jul 2023 21:30:17 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::3d70:a351:b27b:812a]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::3d70:a351:b27b:812a%3]) with mapi id 15.20.6588.028; Sat, 15 Jul 2023 21:30:17 +0000 From: Drew Adams To: "sbaugh@catern.com" Subject: RE: [External] : Re: bug#64619: [PATCH] Add toggle-window-dedicated command Thread-Topic: [External] : Re: bug#64619: [PATCH] Add toggle-window-dedicated command Thread-Index: AQHZtq8gtY1KC46J7kmH1xW6LF/k5a+7V7Ng Date: Sat, 15 Jul 2023 21:30:17 +0000 Message-ID: References: <87jzv2p9e0.fsf@posteo.net> <87zg3yhwpe.fsf@catern.com> In-Reply-To: <87zg3yhwpe.fsf@catern.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|PH7PR10MB6481:EE_ x-ms-office365-filtering-correlation-id: 3ba1b847-2dfd-4ed8-78ff-08db857aaf13 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bmwS2Cb0AeUDyVlMheiTDpKRCCBgLi1TPR562IDZvNkNs4ZYmx2TEofyoBsR69CnR8HlM3S5t9q1J3anlmKyjrFnAHnUtstZv5eUR5bdrv5tm0dl1iXw7avAWV0EN6xcftapqP+5uQSOaCUNyAs6LBmLMW/yyj+AbZ61WIoSPBr2vnpu5EGNWj4Dg/XX3Z6zDSwYTiqXR2GmRNkxU3FFQsESjqCVjYQ53N9nX1Nnhfr5lg90A1U6VbbhObXxPlNIdB4fpfpzeMKZ0Pz6q7ChnC+SCOJIX9KGiXigzVy8lCBxXXcfr09T5TH0JceLxq5x0lwzXp+tVypjsTUz0xWIcU9Vl7I6CKrWtHnKwzCFLdpy2HoTeWeSsqNutRxySneOpCCTiI9EwfoPwHdzPG/eSNYFpQib95cCgVzwUm9OaoZPQ1MH+mI/40Uc+OIg7xT09LpOFyv8dujbjFI4jU9yVpc4fY3jJuW0+uy5CrJG+nrZpebaJmFywt4Y8CzgX4Izs1x0oSMI4faQE/Oc0IBRG+hd4zMo28C9YGb7Dxelp/rzdxDm25VbB+cW0smv203/qN39sJEULc8uElDr6cxwms3MMyJ9JcPi+4ao+JXq7liIgpD+S7feHfcM99AQuKr1 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(366004)(136003)(39860400002)(346002)(376002)(451199021)(478600001)(71200400001)(7696005)(54906003)(186003)(6506007)(26005)(9686003)(76116006)(2906002)(44832011)(316002)(41300700001)(66946007)(66556008)(66476007)(66446008)(64756008)(6916009)(4326008)(5660300002)(52536014)(8936002)(8676002)(38100700002)(122000001)(33656002)(86362001)(38070700005)(83380400001)(55016003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?MN5V66TZfHVNLT3Hkas9z6bCj8PdFVck0EuETb/diljoq73ZsCBnd3qHDe1Y?= =?us-ascii?Q?P5+qxfHyPOemHJwn1/FEyaF45RNLIB0VHPjL4hM2ZDQfud+kXL7KJvtuTjn2?= =?us-ascii?Q?ZN345VOXg0cZky5QGVTjanTz/63uavTMzkkeR28h92T1e3G4ISYk8w/lDfse?= =?us-ascii?Q?f+cyxFZbx3QaE3SrWihz5jEkL6e1kCU8DsJrgy9/b/bs1mAhYCHsVCmwc2kA?= =?us-ascii?Q?VilSpVpdY9WqiY1ySx/1fNmUl0lw8ZdxNFHPSxXKvZUcmvBj/0imysq//ioJ?= =?us-ascii?Q?ks9mTyIy/5vMZIwmnc5DA/v5hIGYDs7m0gB399OCMx2LIb0Zp4/6yAAqptru?= =?us-ascii?Q?gO0rbsIQ7HH2BrRrKinMiNnXBwRmiUlxygMbNugdKV5/dKJbzcpoPKeUiMWz?= =?us-ascii?Q?L0L07mCA+m3Rs/JoQF1zhqlcse8VHAWBYOgMvqZmHs+TkVr8EAxjpKJRST/f?= =?us-ascii?Q?aujEvyJpRgqQbN97aocVXYJJFM1mV9iyy835dsWZYw14Xx33hm0+tPmF4dnH?= =?us-ascii?Q?OgJCueEqdOtPl0A6cVsxyvNKCe2tV6fE6+wgnAoA4dkLAB/O95FtxViayfyQ?= =?us-ascii?Q?b0SOAlSpgqZYFD3OIhTnXCQGu7FWnmSmWAPGgOxGopsJ0x7GEQS3jR+SEIZB?= =?us-ascii?Q?XYZU9ihhDt5Utn20u6F6gZl1ZzYvZ8juD7w4s1LdMqAguKcNHNPVAuVBgU31?= =?us-ascii?Q?zbfAqfD1ZDvDBvzIvC7j5WrgF5YuiIV/+fTtlcA49q+2wblH6D6nhFmzztO0?= =?us-ascii?Q?OKy1v9GeUzIErUPjoiJ0yODefp+k+68GikU+DwjOYbfU6ZgWSPrsGy+pybB4?= =?us-ascii?Q?jMxMObpJhbSQefugQyRUWQh7vysd1ScjnDajrJnW0b0K6SAFQ7g6e5qxyHI+?= =?us-ascii?Q?Z7ejvSWWiJP1CAPJwRJkCICCBTj8wansa2PV7crDNe48bBNh12duRJl/Id1w?= =?us-ascii?Q?wr5/KzT7JzDV54M4SM+3d85eoIHH5p8cKjKqgtmdojEpZ/qRcZ2P2ro8T+vg?= =?us-ascii?Q?kGf8fWTuowj4WDgh1w/Tk7SRyPBFzpF/SpOXG5BnbR59qjdNW3BJXMdsGod5?= =?us-ascii?Q?SCWH7JKYtsWKy/O2ZkEjb1k6HmFLzj2Xo+bMdsPwfrhGJMzbR+ut76OhZwv3?= =?us-ascii?Q?GgAnMhXKpd+iCkOm/PB/5ku2cnIRWfC6qyU4Ui9JNrujZ5Ccx7TwczGj61F6?= =?us-ascii?Q?GB/4SuXrpaWzE/cJ5mrZeUAxnwT1LOHWu8sSq8RdbpVLq1h2zXD7bl8wzy7D?= =?us-ascii?Q?q7ZQKSw+jNCESwnsMZtn9/xhS0qMJv8oX2iJZqO9kkNxZRb99h+0JNS0knac?= =?us-ascii?Q?zU2sKETiTom+2KUSS+41Wz8JvYBVw40abhMfcqsnPkmncz8fhALgRNHyb57m?= =?us-ascii?Q?al7IeBSnfwzZtKKpXhiDenNtF9lf3bN156ZjakY8NsKyOkRrrAmnjWZWC53E?= =?us-ascii?Q?buoQTrGuSrLEoS02UN+QHuPDRPUgFI6tzi/MZZsD/qqjwDekstCoqqARE45T?= =?us-ascii?Q?eqnleli6ngjNqi7nTBW++3zpxiPpokkx3hRlr98uRpf42ajGHr61Ny8svHZs?= =?us-ascii?Q?OLhzJO4YKmEdDiQkhXFY/P/9ZD3J1RmqAuMgUhAA?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ePbZG7yu0cd3pPsFykimGrdpCn8DptW2/p0+lCLMI3A1NXVARmn3NOUhdj5TxJhZmgINaFZ5RJGomvqCzOZq4IoCHIXOaNX2OWg7Gmd/zCNEkovqhCIQy0ustmvaPPXDAS2MF8QIGATpsEQYp9tcqXkXn2KSGRCMNWQ5Jw0uWlyhHrwV1pESFNIlZpb9xtPOH1XUQ5Bk1MJADRPeydvFP4L7BhUDp3GKiMqiYpRaFWvGNWvKbh0F4xAyeggDIqX5Cv4hGsZMDTXr7ltiDyOyzZeKdJq5mUNYGkPw2ms164xiXDaLn5K+EvifRSlNQTjSa5cryyhFghaGlXIOujdA/fz8qDOd6nhmYFTzI6+CbKWlDrZfGajUUdKrKAbBB4v5D6I5dFw5n14c4f4xd8iHuwIgQov/Lw1tkEAChCg4C8HaLWt0wXfYdeSZQdA+x2U7brAj1PX18VP0ZfFVd0S6Wng1va5CVmx4qKKjPOJDVp9ax4ylQtFOGE5+m/B7f2bCtUJUIgyEBv/0kN0ob1E66VYPIVUWuX+Wnm1PL+kPt7FZz+JJzwNTaMLbNUmbNnRd7MjSaEPuRaR1mO+XMKGd2pBOAZjMMRjxpq7WlYRzjOe2tUe4LD1je2ERj1MLCtaDdag/zfwq8DYnW0KR3dQDnJk6ErBQrI85lylM9xZy9XA30pd8DCQdZ4oNFkafc4o2af3IYZano4nwoq4RnalKpZhhuLf/KEMNdp6b7F10peqUm0J8EUOCuJCruDnbd1ZzxKdrV0CxXGWoPJz69dDH7sdQfjwBgTvBsX88tYJk2+Ten8Hp4qLO7UNCEpFhkJ6mc8Cg0OQHzhSU4sSIGwyZ1K8pch4Bbd8cxmYGm8w8yn4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ba1b847-2dfd-4ed8-78ff-08db857aaf13 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jul 2023 21:30:17.2822 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xeyTWsG6Ye4Nl+J8YInH0wEN/64qZwJERu7gcLEHB3vsROSfPJeFqhzG7k5JNc2qB1FEB6LHaB1F6PcsnoP5vA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6481 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-15_10,2023-07-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxscore=0 phishscore=0 adultscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=375 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307150205 X-Proofpoint-GUID: FMDxGLJkog6DwoKq1F_p6NUc60v1oxDD X-Proofpoint-ORIG-GUID: FMDxGLJkog6DwoKq1F_p6NUc60v1oxDD X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 64619 Cc: Spencer Baugh , Philip Kaludercic , "64619@debbugs.gnu.org" <64619@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > > 1. Why _weakly_ dedicated? >=20 > AFAIK, the difference is that if you explicitly try to switch buffer > with e.g. C-x b, you succeed when the dedication is weak, and fail with > an error when the dedication is strong. I find that if I explicitly hit > C-x b, I want to actually switch buffers in the current window, I never > want the switch to fail. Making it fail seems useful for Lisp programs, > sometimes, but not so much interactive usage. Thanks for providing your reasons/rationale. That's the behavior you prefer, as one user. Other users can prefer strong, not weak. (But I see, below, that you're considering providing both.) Let's not forget that "weak" dedication was added as an additional, optional behavior, decades after ordinary (aka strong) dedication was in use. > > 2. Why not just this? > > > > (let ((before (window-dedicated-p window))) > > (set-window-dedicated-p window (not before)) > > (when interactive > > (message "Window is %s dedicated to buffer %s" > > (if before "no longer" "now") > > (current-buffer)))) > > > > If someone might not know what it means for a > > window to be dedicated, put that info in the > > doc string, not in the message. >=20 > Will do. Maybe you won't want that toggling to `t' instead of `dedicated', given your preference expressed above? (`not' nil returns `t'.) > > 3. The toggle, as OP proposed it, imposes weak > > dedication, and the toggle as I wrote it above > > imposes strong dedication. What if you want > > a toggle that respects whatever non-nil FLAG > > (weak or strong) might have already been used > > for the window? > > > > IOW, what if the window is dedicated to start > > with, before you first use the toggle, and you > > want to get back that same dedicated behavior > > (weak or strong) when you toggle it back again? > > The toggle (either definition) doesn't do that. >=20 > That would be nice, but I don't see a way to do it. At the same time, I > think it's probably fine for the user to explicitly choose whether they > want it to be weak or strong. After all, this way it allows the user to > change the dedicated mode. Yes, that's where I was heading with that: not easy to do, and we can just let users choose which behavior they want. > > Shouldn't the doc make clear that the toggling > > behavior is always between weak & undedicated > > (OP version) or always between strong & > > undedicated (my version, above)? IOW, let a > > user know that any original dedicated behavior > > is lost, once you use the toggle. > > > > Or if you want to let a user specify whether > > to use weak or strong, maybe do that with a > > prefix arg? >=20 > Good point, I'll add a prefix arg for strong dedication. Thx. (Though I'd prefer it the other way 'round. ;-)) From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 15 20:57:47 2023 Received: (at 64619) by debbugs.gnu.org; 16 Jul 2023 00:57:47 +0000 Received: from localhost ([127.0.0.1]:46274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKq54-0004Ak-TR for submit@debbugs.gnu.org; Sat, 15 Jul 2023 20:57:47 -0400 Received: from s.wrqvtbkv.outbound-mail.sendgrid.net ([149.72.123.24]:9780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKq51-0004AS-8B for 64619@debbugs.gnu.org; Sat, 15 Jul 2023 20:57:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=subject:in-reply-to:from:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=3FXt9UwobL9Pcoe5/vgSS5ICGDLBDrjL1x87Hf+8QQ4=; b=A8BGxp6mEnwChSfCtlPAN87Q+OhbRSAIXpW5zjgqj9sR0Scq3acNk8q7NIsejmZmiT5h QP8sIACdSILWtrhl2jPrc4BmYukFwlcg9ZF2V/sMRyPEG9WmttYJr6ZnwKVdVxONx6zCvm eOsWo8P0hAGAg75sNkmW0gccXw0ZP096XrodLuOLG05IXoEPBeZLscbueJsGIxf/IRCg9c jP+ycnp8GWEtLRx3Cku/hod7Fxpfcf3SguZrpji1KauOx4+TQAugFBCGA+iClxnlHcJHE+ 7kqkduEd5dvyoviD2MtergTV7O2KePucj5hDN228Hyq2bfwQONeCMJeDJ7LDzasg== Received: by filterdrecv-77869f68cc-l7kjz with SMTP id filterdrecv-77869f68cc-l7kjz-1-64B34081-15 2023-07-16 00:57:37.60107889 +0000 UTC m=+5707300.685540285 Received: from earth.catern.com (unknown) by geopod-ismtpd-2 (SG) with ESMTP id ASs-O-DfQrSo3AgRHqXEGA Sun, 16 Jul 2023 00:57:37.537 +0000 (UTC) Date: Sun, 16 Jul 2023 00:57:37 +0000 (UTC) Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command Message-ID: <9def7178-09e6-4ad3-8ba6-66691d502ca9@email.android.com> X-Android-Message-ID: <9def7178-09e6-4ad3-8ba6-66691d502ca9@email.android.com> In-Reply-To: <7fa045fd-88ec-c2a0-23e1-a74d4da61f97@gmx.at> From: Spencer Baugh Importance: Normal X-Priority: 3 X-MSMail-Priority: Normal MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?GW3oCMoYnalRiojMOuLzE6x2H5kORXvlCdz1UwQVRMVT4fbh9ODEfCogOe74cO?= =?us-ascii?Q?rI4e0V+MFZgakz9Re5a6=2FCguWqeFQ292nR7=2F7nE?= =?us-ascii?Q?osw+GpMy=2FoqzHmPfYvT7exu1ervP8zp=2F8Q7SUSc?= =?us-ascii?Q?ve8c2F=2FtJsUlE5HGL+3c6DUFFa1U5=2Fl6XCp6W4W?= =?us-ascii?Q?kGvUJC0vtkRzM8xPhKPRoq3eiGzjusGeaMrZA0J?= =?us-ascii?Q?INv216+OSzQkV2KLqadpnezgHvNWGjfFzyBBxB?= To: martin rudalics X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: base64 X-Spam-Score: 1.7 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Jul 15, 2023 14:16, martin rudalics wrote: > Yes, this is about making windows dedicated, not making them not > dedicated. I implemented it as a toggle only because that seems nicer > to a user who might otherwise make a window dedicated on ac [...] Content analysis details: (1.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [149.72.123.24 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 MIME_HTML_ONLY BODY: Message only has text/html MIME parts 0.0 HTML_MESSAGE BODY: HTML included in message 0.0 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 0.6 HTML_MIME_NO_HTML_TAG HTML-only message, but there is no HTML tag -0.0 T_SCC_BODY_TEXT_LINE No description available. 1.0 MALF_HTML_B64 Malformatted base64-encoded HTML content X-Debbugs-Envelope-To: 64619 Cc: Spencer Baugh , Eli Zaretskii , 64619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) PGRpdiBkaXI9J2F1dG8nPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9leHRyYSIgZGlyPSJhdXRvIj48 ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gSnVsIDE1LCAyMDIzIDE0OjE2LCBtYXJ0aW4gcnVk YWxpY3MgJmx0O3J1ZGFsaWNzQGdteC5hdCZndDsgd3JvdGU6PGJyIHR5cGU9ImF0dHJpYnV0aW9u Ij48YmxvY2txdW90ZSBjbGFzcz0icXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAgLjhleDtib3Jk ZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4Ij48cCBkaXI9Imx0ciI+ICZn dDsgWWVzLCB0aGlzIGlzIGFib3V0IG1ha2luZyB3aW5kb3dzIGRlZGljYXRlZCwgbm90IG1ha2lu ZyB0aGVtIG5vdAo8YnI+CiAmZ3Q7IGRlZGljYXRlZC4mbmJzcDsgSSBpbXBsZW1lbnRlZCBpdCBh cyBhIHRvZ2dsZSBvbmx5IGJlY2F1c2UgdGhhdCBzZWVtcyBuaWNlcgo8YnI+CiAmZ3Q7IHRvIGEg dXNlciB3aG8gbWlnaHQgb3RoZXJ3aXNlIG1ha2UgYSB3aW5kb3cgZGVkaWNhdGVkIG9uIGFjY2lk ZW50IGFuZAo8YnI+CiAmZ3Q7IG5vdCBrbm93IGhvdyB0byB1bmRvIGl0Lgo8YnI+Cgo8YnI+CkJ1 dCBob3cgd291bGQgb3VyIHVzZXIga25vdyB3aGljaCBvZiBoaXMgd2luZG93cyBhcmUgZGVkaWNh dGVkPwo8YnI+CidkaXNwbGF5LWJ1ZmZlcicgd29uJ3QgdGVsbCBiZWNhdXNlIGl0IHNpbGVudGx5 IGlnbm9yZXMgdGhlbS4KPGJyPgoKPGJyPgptYXJ0aW48L3A+PC9ibG9ja3F1b3RlPjwvZGl2Pjwv ZGl2PjxkaXYgZGlyPSJhdXRvIj5PaCwgbWF5YmUsIHNlcGFyYXRlIGZyb20gdGhpcyBidWcsIHdl IHNob3VsZCBzaG93IHdoZXRoZXIgYSB3aW5kb3cgaXMgZGVkaWNhdGVkIGluIHRoZSBtb2RlbGlu ZS4gSSB0aGluayB0aGF0IHdvdWxkIHF1aXRlIHVzZWZ1bCwgc2luY2Ugb3RoZXJ3aXNlIHVzYWdl IG9mIGRlZGljYXRlZCB3aW5kb3dzIGV2ZW4gb3V0c2lkZSB0aGlzIHBhdGNoIGNhbiBiZSBjb25m dXNpbmcgdG8gdXNlcnMgYnkgY2hhbmdpbmcgZGlzcGxheS1idWZmZXIgYmVoYXZpb3IuPC9kaXY+ PGRpdiBjbGFzcz0iZ21haWxfZXh0cmEiIGRpcj0iYXV0byI+PGJyPjwvZGl2PjwvZGl2Pg== From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 18 11:34:17 2023 Received: (at 64619) by debbugs.gnu.org; 18 Jul 2023 15:34:17 +0000 Received: from localhost ([127.0.0.1]:54002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLmiP-00088X-Ai for submit@debbugs.gnu.org; Tue, 18 Jul 2023 11:34:17 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:59059) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLmiN-00088J-GM for 64619@debbugs.gnu.org; Tue, 18 Jul 2023 11:34:16 -0400 To: 64619@debbugs.gnu.org From: Spencer Baugh Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: (Spencer Baugh's message of "Fri, 14 Jul 2023 11:38:59 -0400") References: Date: Tue, 18 Jul 2023 11:34:10 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: martin rudalics , Eli Zaretskii , Philip Kaludercic , Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain OK, this patch adds support for making the buffer strongly dedicated with a prefix argument, and also adds an indicator to the mode line of whether the current window is dedicated (which seems useful even if we don't apply the toggle part of this patch). I wonder if we should support clicking on the mode line indicator to turn off dedicated status? The tricky thing is that the mode line indicator disappears when the window isn't dedicated, so there's no way to turn it back *on* using the mouse. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-toggle-window-dedicated-command-and-mode-line-wi.patch >From 6346388d0992ad78b42e79590db60f2f337b0b88 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Fri, 14 Jul 2023 11:38:24 -0400 Subject: [PATCH] Add toggle-window-dedicated command and mode-line-window-dedicated It's sometimes useful to interactively make certain windows dedicated. This allows a level of interactive control over which window display-buffer uses. Additionally, when a window is dedicated (even without this new command) it can affect display-buffer behavior in ways which may be unexpected for users. Let's display the window dedicated status in the mode-line to help indicate what's going on. * lisp/window.el (toggle-window-dedicated): Add. (window-prefix-map): Add C-x w d binding. * lisp/bindings.el (mode-line-window-control): Add. (mode-line-window-dedicated): Add. (standard-mode-line-format): Insert mode-line-window-dedicated. --- lisp/bindings.el | 22 ++++++++++++++++++++++ lisp/window.el | 28 ++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/lisp/bindings.el b/lisp/bindings.el index 0a0fef1b564..a570b5d6a7b 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -298,6 +298,27 @@ mode-line-frame-identification ;;;###autoload (put 'mode-line-frame-identification 'risky-local-variable t) +(defun mode-line-window-control () + "Compute mode line construct for window dedicated state. +Value is used for `mode-line-window-dedicated', which see." + (cond + ((eq (window-dedicated-p) t) + '(:propertize + " D" + help-echo "Window is strongly dedicated to current buffer" + mouse-face 'mode-line-highlight)) + ((window-dedicated-p) + '(:propertize + " d" + help-echo "Window is dedicated to current buffer" + mouse-face 'mode-line-highlight)) + (t ""))) + +(defvar mode-line-window-dedicated '(:eval (mode-line-window-control)) + "Mode line construct to describe the current window.") +;;;###autoload +(put 'mode-line-window-dedicated 'risky-local-variable t) + (defvar-local mode-line-process nil "Mode line construct for displaying info on process status. Normally nil in most modes, since there is no process to display.") @@ -678,6 +699,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 " " diff --git a/lisp/window.el b/lisp/window.el index d91bbabc010..259c1e679ac 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7463,6 +7463,33 @@ display-buffer-mark-dedicated The actual non-nil value of this variable will be copied to the `window-dedicated-p' flag.") +(defun toggle-window-dedicated (&optional window flag interactive) + "Toggle whether WINDOW is dedicated. + +See `set-window-dedicated-p' for more details. WINDOW defaults +to the currently selected window. FLAG defaults to +`dedicated' (weak dedication) or `t' (strong dedication) with a +prefix argument. If INTERACTIVE is non-nil, will print a message +about the dedication status of the window afterwards." + (interactive "i\nP\np") + (setq window (window-normalize-window window)) + (setq flag (cond + ((consp flag) t) + ((null flag) 'dedicated) + (t flag))) + (if (window-dedicated-p window) + (set-window-dedicated-p window nil) + (set-window-dedicated-p window flag)) + (when interactive + (message "Window is %s dedicated to buffer %s" + (let ((status (window-dedicated-p window))) + (cond + ((null status) "no longer") + ((eq status t) "now strongly") + (t "now"))) + (current-buffer)) + (force-mode-line-update))) + (defconst display-buffer--action-function-custom-type '(choice :tag "Function" (const :tag "--" ignore) ; default for insertion @@ -10746,6 +10773,7 @@ window-prefix-map "2" #'split-root-window-below "3" #'split-root-window-right "s" #'window-toggle-side-windows + "d" #'toggle-window-dedicated "^ f" #'tear-off-window "^ t" #'tab-window-detach "-" #'fit-window-to-buffer -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 18 11:35:37 2023 Received: (at 64619) by debbugs.gnu.org; 18 Jul 2023 15:35:37 +0000 Received: from localhost ([127.0.0.1]:54006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLmjg-0008Aw-Tx for submit@debbugs.gnu.org; Tue, 18 Jul 2023 11:35:37 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:58765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLmjd-0008Ag-JE for 64619@debbugs.gnu.org; Tue, 18 Jul 2023 11:35:35 -0400 From: Spencer Baugh To: Philip Kaludercic Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <87jzv2p9e0.fsf@posteo.net> (Philip Kaludercic's message of "Fri, 14 Jul 2023 19:42:47 +0000") References: <87jzv2p9e0.fsf@posteo.net> Date: Tue, 18 Jul 2023 11:35:28 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Philip Kaludercic writes: > Spencer Baugh writes: >> + (interactive "i\np") > > How about > > (interactive (list (window-normalize-window window) t)) WINDOW isn't in scope of the interactive spec (AFAIK?), so we can't process that window argument this way, we need to do it in the body. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 18 13:56:14 2023 Received: (at 64619) by debbugs.gnu.org; 18 Jul 2023 17:56:14 +0000 Received: from localhost ([127.0.0.1]:54246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLovm-00069q-HC for submit@debbugs.gnu.org; Tue, 18 Jul 2023 13:56:14 -0400 Received: from mout02.posteo.de ([185.67.36.66]:55767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLovj-00069b-Rw for 64619@debbugs.gnu.org; Tue, 18 Jul 2023 13:56:12 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id AADD0240103 for <64619@debbugs.gnu.org>; Tue, 18 Jul 2023 19:56:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1689702965; bh=q1la0koUCO0XS+gplWTS6wU0dpETLIlfAAMMOPjXp7w=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=lWd0XNw+KbpW01kYzhAly09VmHPm+fpZpMv0G7WFN25dJ/Rc/KRugOMXAXn30FfdM ZTvV6IxpfvspiIGf0lDBLmjzO6ZzCU3kwh0bXyFEYLpl7ndkglbYESxlZk6fPb4Hk7 ipo0NCzoI7oSuliZxtIP3nCmK1QxYXsChNbyYwR1U1cxO93eA+nsPJiv35jrf2aL6J 7aFlheQcxxYtkNfjbVaebPNNv0VaL4af1yitI7/uLiyHekNLbCJcp0W3e9StEpqnhS TT6BLvi7zb32G+xGHXNxfZl0wS9CpL2icLUsgW+fskdFZKHnkNwuO0vbWSeFARw9aw OtpHXA+9DXwvQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4R567n1bGqz6txY; Tue, 18 Jul 2023 19:56:05 +0200 (CEST) From: Philip Kaludercic To: Spencer Baugh Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: (Spencer Baugh's message of "Tue, 18 Jul 2023 11:35:28 -0400") References: <87jzv2p9e0.fsf@posteo.net> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Date: Tue, 18 Jul 2023 17:56:03 +0000 Message-ID: <87r0p5t87g.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Spencer Baugh writes: > Philip Kaludercic writes: >> Spencer Baugh writes: >>> + (interactive "i\np") >> >> How about >> >> (interactive (list (window-normalize-window window) t)) > > WINDOW isn't in scope of the interactive spec (AFAIK?), so we can't > process that window argument this way, we need to do it in the body. Of course, what I meant to say was (window-normalize-window nil) or (selected-window). From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 19 09:34:56 2023 Received: (at 64619) by debbugs.gnu.org; 19 Aug 2023 13:34:56 +0000 Received: from localhost ([127.0.0.1]:49717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXM6S-0007AH-Ev for submit@debbugs.gnu.org; Sat, 19 Aug 2023 09:34:56 -0400 Received: from s.wrqvtzvf.outbound-mail.sendgrid.net ([149.72.126.143]:31816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXM6N-00079z-V5 for 64619@debbugs.gnu.org; Sat, 19 Aug 2023 09:34:55 -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=qbK0Ga/J6fVG/nq1xSs9hMBjUliAwcAIo1Ph1dquQOk=; b=A+4mYAWTDUmwYLBEV7WpVGfnyRNqssGI4j+QW7SxYilpcJPSLJ8YtgpZMQ0MJs0aQxhd undInseO39WiroFAsYRuJvclQZnHlCVk4n/gjm2Nah2oHR8dcPkHbO29hIYxtW0tc7BMKo qHOgRcmWtPylRyKB0iGYfs2rDAAUZV7D5teu03vdV3N9uvCp5s7cg6b789Qxyqdba71uBx cHJmO0CxyiO5Tw/j0WRW0c9dRAHvX2oZxs1vQabvyuKTJBo9feBqGX7hzCnei4ooCkmLWh rZuAZEFumzrYb5lQ05lcPGBz+55c46WWI7Tulfa02AW2LoR1YfA+IH8KFLNKfd1Q== Received: by filterdrecv-84b96456cb-vm9rv with SMTP id filterdrecv-84b96456cb-vm9rv-1-64E0C4F4-1A 2023-08-19 13:34:44.833069482 +0000 UTC m=+8690159.587093625 Received: from earth.catern.com (unknown) by geopod-ismtpd-23 (SG) with ESMTP id S_J4ixA8TuuwWvYcVKOv-Q Sat, 19 Aug 2023 13:34:44.628 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=janestreet.com Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 23F4B6001E; Sat, 19 Aug 2023 09:34:44 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: (Spencer Baugh's message of "Tue, 18 Jul 2023 11:34:10 -0400") References: Date: Sat, 19 Aug 2023 13:34:44 +0000 (UTC) Message-ID: <87h6ovgnpn.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbKjUnWGSKHSi123HiDddt?= =?us-ascii?Q?wX2=2F3UVsh8y+Mz1SViq8ea5EhjX4J2DOtVJVnbE?= =?us-ascii?Q?skkuduUXPrqSDczOah5qX2iaauPtGxA=2F9VBM=2F7b?= =?us-ascii?Q?ODkxsKvndvDbnR3ScLNzb3yehMWSXtcjgpvABHO?= =?us-ascii?Q?IFraYOuvsnqrxwfP3GiIGdeep++gkXeA4Lg=3D=3D?= To: Spencer Baugh X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Spencer Baugh writes: > OK, this patch adds support for making the buffer strongly dedicated > with a prefix argument, and also adds an indicator to the mode line of > whether [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [149.72.126.143 listed in wl.mailspike.net] 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, Eli Zaretskii , Philip Kaludercic , Drew Adams , martin rudalics X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) Spencer Baugh writes: > OK, this patch adds support for making the buffer strongly dedicated > with a prefix argument, and also adds an indicator to the mode line of > whether the current window is dedicated (which seems useful even if we > don't apply the toggle part of this patch). Any thoughts on this patch? From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 19 12:13:42 2023 Received: (at 64619) by debbugs.gnu.org; 19 Aug 2023 16:13:42 +0000 Received: from localhost ([127.0.0.1]:52185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXOa2-0003cY-Pi for submit@debbugs.gnu.org; Sat, 19 Aug 2023 12:13:42 -0400 Received: from mout02.posteo.de ([185.67.36.66]:50445) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXOZx-0003cG-Kn for 64619@debbugs.gnu.org; Sat, 19 Aug 2023 12:13:37 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 9A736240101 for <64619@debbugs.gnu.org>; Sat, 19 Aug 2023 18:13:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1692461606; bh=MHusUcOQp2ewnaPRq7cuNRYxfC5+Gxp6H74L0dMn9Gw=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=C1DpXoVFWBK6GvIuGloYHIPAoEVCDonCaBtJMv8Zp8wVAfwk3tPNWXDetrnRORF48 VbTGKzqjhAVj4+cVdtXM+IOY7vfRTvSujKQU+ftyyePoMux1NCrytAy53DipnTeotF TuKgwR1BHe/oZchVuwGYwjXdDtLjYBeACmUBdpt69wUP0WUuRSGivAQunVw3RtmWcu KNTdSnnwZT3trNHtWsbfEBg/dX8WyDe1gn9VQcvD/r1RZNUrOzkiFG/Gb6iItskRxl dHwQvRPI/vABCrdGj24pDux/Q274Fyo8GLrSw0bHQzrFUeCuEEDVGyJNN+RTW2Or2R z52u52xVLtSWg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RSkLY6mhHz9rxH; Sat, 19 Aug 2023 18:13:25 +0200 (CEST) From: Philip Kaludercic To: Spencer Baugh Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <87h6ovgnpn.fsf@catern.com> (sbaugh@catern.com's message of "Sat, 19 Aug 2023 13:34:44 +0000 (UTC)") References: <87h6ovgnpn.fsf@catern.com> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Date: Sat, 19 Aug 2023 16:13:25 +0000 Message-ID: <874jkvvwm2.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, Eli Zaretskii , Drew Adams , martin rudalics X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) sbaugh@catern.com writes: > Spencer Baugh writes: >> OK, this patch adds support for making the buffer strongly dedicated >> with a prefix argument, and also adds an indicator to the mode line of >> whether the current window is dedicated (which seems useful even if we >> don't apply the toggle part of this patch). > > Any thoughts on this patch? I just tried it out and it works as advertised. The only question is if a NEWS entry should be added, or if it is worth mentioning it in the manual? (P.S. I have had issues sending this message, but perhaps I might have done something wrong as well: "smtpmail-send-it: Sending failed: 450 4.1.2 : Recipient address rejected: Domain not found") From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 19 12:20:14 2023 Received: (at 64619) by debbugs.gnu.org; 19 Aug 2023 16:20:14 +0000 Received: from localhost ([127.0.0.1]:52200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXOgQ-0003nw-61 for submit@debbugs.gnu.org; Sat, 19 Aug 2023 12:20:14 -0400 Received: from s.wrqvtzvf.outbound-mail.sendgrid.net ([149.72.126.143]:52030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXOgO-0003nf-7D for 64619@debbugs.gnu.org; Sat, 19 Aug 2023 12:20:13 -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=Tg3m7S6v6fBe9izDK+hSs5Hx8DpaysZCrUEmi2qsLF8=; b=zP+HrczwDttpL/Fhu0coaHomjKi2HAv8+wP33dVpAranPhE5vNwZkklLeiSoehfwLwKC Z7OHiffUBPShAeVcikC8ui9HFLuo18IJp3N/wCyRFFI3MvwnSJmTwMFnlbj9jAAmEwiEti RLM07D/wI9avzoAP5JITVBEKN086SJg4ih5zrul9pNXm+n+m4gBOUxwaOsEE3KE23P1ABu Pqv4ZUtwIy084M3C/O1o69VdQGxOtIXuoTvjpPeEpLbiQHIXaFQ0pUiWjpHJ2+gR9lee5C nHX8TAeX3AEsyK7ryD9jPXNqvr2CBKQfj+1Tsu2hUqPGUQZ9ltat2DiprLQXc5nQ== Received: by filterdrecv-canary-78ff49ff78-6jdhb with SMTP id filterdrecv-canary-78ff49ff78-6jdhb-1-64E0EBB5-11 2023-08-19 16:20:05.307271869 +0000 UTC m=+8700027.301206146 Received: from earth.catern.com (unknown) by geopod-ismtpd-36 (SG) with ESMTP id hTARxLVSTYuqVfewx_4jDw Sat, 19 Aug 2023 16:20:05.263 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=posteo.net Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id BCFC860059; Sat, 19 Aug 2023 12:20:04 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <874jkvvwm2.fsf@posteo.net> (Philip Kaludercic's message of "Sat, 19 Aug 2023 16:13:25 +0000") References: <87h6ovgnpn.fsf@catern.com> <874jkvvwm2.fsf@posteo.net> Date: Sat, 19 Aug 2023 16:20:05 +0000 (UTC) Message-ID: <87jztr0zt7.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbKlPjOs7kyBMPFPR1aG1u?= =?us-ascii?Q?qIZVRSb7dIwjRmS8dOP0hffcj=2FiUw2LwEAy7xbs?= =?us-ascii?Q?FQruCIHxyHp0X4OteXuwLZ3wNh=2FJU5ELjEqCYMx?= =?us-ascii?Q?KP3oWQfpqBTFjyFzbvXOB8IKMozPrtTvUDoU913?= =?us-ascii?Q?PBAuBWZiT5SvtbgM+wBwNIcFPM=2F1B+vNIcac1rl?= =?us-ascii?Q?WUs6rjIOEse=2FzsAH8=3D?= To: Philip Kaludercic X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Philip Kaludercic writes: > sbaugh@catern.com writes: > >> Spencer Baugh writes: >>> OK, this patch adds support for making the buffer strongly dedicated >>> with a prefix argument, and also adds an ind [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [149.72.126.143 listed in wl.mailspike.net] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Debbugs-Envelope-To: 64619 Cc: Spencer Baugh , Eli Zaretskii , martin rudalics , Drew Adams , 64619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) Philip Kaludercic writes: > sbaugh@catern.com writes: > >> Spencer Baugh writes: >>> OK, this patch adds support for making the buffer strongly dedicated >>> with a prefix argument, and also adds an indicator to the mode line of >>> whether the current window is dedicated (which seems useful even if we >>> don't apply the toggle part of this patch). >> >> Any thoughts on this patch? > > I just tried it out and it works as advertised. The only question is if > a NEWS entry should be added, or if it is worth mentioning it in the > manual? Yes, I think definitely a NEWS entry is warranted, if only because it adds an indicator the mode line. But I wanted to settle the format before writing it. > (P.S. I have had issues sending this message, but perhaps I might have > done something wrong as well: "smtpmail-send-it: Sending failed: 450 > 4.1.2 : Recipient address rejected: Domain not found") That's because my DNS/mail server just crashed :) From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 19 12:21:45 2023 Received: (at 64619) by debbugs.gnu.org; 19 Aug 2023 16:21:45 +0000 Received: from localhost ([127.0.0.1]:52208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXOht-0003r9-5T for submit@debbugs.gnu.org; Sat, 19 Aug 2023 12:21:45 -0400 Received: from mout02.posteo.de ([185.67.36.66]:46043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXOhr-0003qs-N8 for 64619@debbugs.gnu.org; Sat, 19 Aug 2023 12:21:44 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id DE03E240103 for <64619@debbugs.gnu.org>; Sat, 19 Aug 2023 18:21:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1692462096; bh=nydunbYNKw/+Z7G7MDeTNyrzK1H1ETNQgK0taZw80QM=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=Ym26BcVxFXwk2nAKEeT08G0x7vH4KJpID4hsV7JIIiE7R7yqDGJR/6bbRxgtRNM/O DKTjNc0xAKgjL1vJkpq4QH1qadQucUcUjz7IlywYapbJBFjLIFcNPrHTkkDf9lIqoq bXoXqgPtpMrvSD6rvChUWSGs5aHNUDWGrwKc0T884yMQ7b8LYlo+WdWSiPtQHpzIQx cSdZfh8yd8aNiebSRqaAvstD4TTZnnU8zcg620YGrKEyKw3IrR4DWI9E/egxRhyeQq fokGgsM8IH1t4cVYhBt/hweP+3tl6R2DdKINW89ILGrzuIog3a26FzG/JfbURX7IX5 nxcfzNgsNdaoQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RSkWz5v29z6tvZ; Sat, 19 Aug 2023 18:21:35 +0200 (CEST) From: Philip Kaludercic To: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <87jztr0zt7.fsf@catern.com> (sbaugh@catern.com's message of "Sat, 19 Aug 2023 16:20:05 +0000 (UTC)") References: <87h6ovgnpn.fsf@catern.com> <874jkvvwm2.fsf@posteo.net> <87jztr0zt7.fsf@catern.com> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Date: Sat, 19 Aug 2023 16:21:35 +0000 Message-ID: <87zg2nuho0.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: Spencer Baugh , Eli Zaretskii , martin rudalics , Drew Adams , 64619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) sbaugh@catern.com writes: > Philip Kaludercic writes: > >> sbaugh@catern.com writes: >> >>> Spencer Baugh writes: >>>> OK, this patch adds support for making the buffer strongly dedicated >>>> with a prefix argument, and also adds an indicator to the mode line of >>>> whether the current window is dedicated (which seems useful even if we >>>> don't apply the toggle part of this patch). >>> >>> Any thoughts on this patch? >> >> I just tried it out and it works as advertised. The only question is if >> a NEWS entry should be added, or if it is worth mentioning it in the >> manual? > > Yes, I think definitely a NEWS entry is warranted, if only because it > adds an indicator the mode line. But I wanted to settle the format > before writing it. I think it is fine the way it is right now. >> (P.S. I have had issues sending this message, but perhaps I might have >> done something wrong as well: "smtpmail-send-it: Sending failed: 450 >> 4.1.2 : Recipient address rejected: Domain not found") > > That's because my DNS/mail server just crashed :) Testing :) From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 19 12:43:26 2023 Received: (at 64619) by debbugs.gnu.org; 19 Aug 2023 16:43:26 +0000 Received: from localhost ([127.0.0.1]:52213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXP2p-0004Pt-7g for submit@debbugs.gnu.org; Sat, 19 Aug 2023 12:43:26 -0400 Received: from heytings.org ([95.142.160.155]:45068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXP2k-0004Pe-9Z for 64619@debbugs.gnu.org; Sat, 19 Aug 2023 12:43:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1692463395; bh=1/+truucZJqjBcepAC8U6IROoFZSq2fPUtyWAdYzwGk=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=K9xHWhJwzc225KrwOcqNGyXCE0ZUUBbDUBcFpxT2EPWvvxGrYbBS7Vrrsz6+iVvja 6K3vGL0wx9QkPknVZOkHWW2C5qC/CD06FaS80qnA/jbc9Prg6forCPGxWZLbS/PTR9 MVzV6+iUE2Z+DsTzJoCqEtCRR3Ygi627ft6amaK9CjwPBLhpk2bc2hv6dkReVp8ScI DKDyx/KXCG+E+mYUueZOSvHKnDgxDcjcVsb1c3jtzoUHFJtDWaEXfU25PlMltx01h/ wpq1Ri4hc47oauSe7JqIa4bgSI1DgqVJgO63DbzujbQ+lENddAwOWH+/vZ5otv3eAP 03yZlotaZefJA== Date: Sat, 19 Aug 2023 16:43:15 +0000 From: Gregory Heytings To: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <87h6ovgnpn.fsf@catern.com> Message-ID: <387ee04aa9601b936ac5@heytings.org> References: <87h6ovgnpn.fsf@catern.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: Spencer Baugh , Philip Kaludercic , 64619@debbugs.gnu.org, martin rudalics , Eli Zaretskii , Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> OK, this patch adds support for making the buffer strongly dedicated >> with a prefix argument, and also adds an indicator to the mode line of >> whether the current window is dedicated (which seems useful even if we >> don't apply the toggle part of this patch). > > Any thoughts on this patch? > Two thoughs: 1. I would simplify the body of toggle-window-dedicated, using (set-window-dedicated-p window (not (window-dedicated-p))) This makes the window "strongly" dedicated, which is more in line with what "Window will now display only its current buffer" promises (e.g. C-x b will refuse to switch to another buffer). 2. I would not bind it to the "d" key but to the "!" key: ISTM that toggling window dedication is not such a common action that it needs a letter key binding. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 19 16:02:48 2023 Received: (at 64619) by debbugs.gnu.org; 19 Aug 2023 20:02:48 +0000 Received: from localhost ([127.0.0.1]:52347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXS9n-0000ww-TL for submit@debbugs.gnu.org; Sat, 19 Aug 2023 16:02:48 -0400 Received: from s.wrqvtbkv.outbound-mail.sendgrid.net ([149.72.123.24]:50816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXS9i-0000wf-HO for 64619@debbugs.gnu.org; Sat, 19 Aug 2023 16:02:46 -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: cc:content-type:from:subject:to; s=s1; bh=fwNGFBP9MzZ4gQGc1hFzIHW88jLy2j5Q4PMJDJWiMNc=; b=b5PAloECSDVT6R76k42ilSIeVY32BjdXIwstzXgL/98DtcPkKjShlUMg98Bjq186F0Ps 4NCswF0nx/lP26xeQZ0oOmwA5+GhvG30xXUdinyIYz2/n5F0XHFrtTNDtsVmDamqi8srvI sJq4xgNZAYcSn7u4id5tEierY17nziSpNKiHWfl+xuA2LJnhu/EeSh1FuJ4fLzV3XoFIYZ Gy+NzVxnZ2wN85A6EPjWq6dGdHvHlpC8QXFGyX9Oz3qw4vjou+egHkiJE6KStNCy3dLOm9 uizAc7R56basDBWPwTI1BhpoQw/agGkR8bMduxt7X5qaRcvsQghnTZ2505RpI50A== Received: by filterdrecv-66949dbc98-p7b6v with SMTP id filterdrecv-66949dbc98-p7b6v-1-64E11FDB-10 2023-08-19 20:02:35.19988688 +0000 UTC m=+8713369.251518835 Received: from earth.catern.com (unknown) by geopod-ismtpd-29 (SG) with ESMTP id Uktpuem5Qbq_yNM2CGWFkA Sat, 19 Aug 2023 20:02:35.035 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=posteo.net Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 7F0986257B; Sat, 19 Aug 2023 16:02:34 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <87zg2nuho0.fsf@posteo.net> (Philip Kaludercic's message of "Sat, 19 Aug 2023 16:21:35 +0000") References: <87h6ovgnpn.fsf@catern.com> <874jkvvwm2.fsf@posteo.net> <87jztr0zt7.fsf@catern.com> <87zg2nuho0.fsf@posteo.net> Date: Sat, 19 Aug 2023 20:02:35 +0000 (UTC) Message-ID: <877cpqreat.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbJjDFq7v=2FYiFOBL0YJnlO?= =?us-ascii?Q?0XGALxdYmllMUFQeoJ6On9UMZ+2P+91vfpI+q2B?= =?us-ascii?Q?tKSL7arBnZvTdUbjheBhheCi4YDWI9RmXRSDi+V?= =?us-ascii?Q?Fz9z0jhc1fp56vcp+e1YbZBfW5JCAd6aoGUcxej?= =?us-ascii?Q?5lteQWnA1mG3cIC=2Fw0eJpR2Yp+xCCxjcRmw=3D=3D?= To: Philip Kaludercic X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: Spencer Baugh , Eli Zaretskii , 64619@debbugs.gnu.org, Drew Adams , martin rudalics X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Philip Kaludercic writes: > sbaugh@catern.com writes: > >> Philip Kaludercic writes: >> >>> sbaugh@catern.com writes: >>> >>>> Spencer Baugh writes: >>>>> OK, this patch adds support for making the buffer strongly dedicated >>>>> with a prefix argument, and also adds an indicator to the mode line of >>>>> whether the current window is dedicated (which seems useful even if we >>>>> don't apply the toggle part of this patch). >>>> >>>> Any thoughts on this patch? >>> >>> I just tried it out and it works as advertised. The only question is if >>> a NEWS entry should be added, or if it is worth mentioning it in the >>> manual? >> >> Yes, I think definitely a NEWS entry is warranted, if only because it >> adds an indicator the mode line. But I wanted to settle the format >> before writing it. > > I think it is fine the way it is right now. OK, added a NEWS entry and information in the manual. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-toggle-window-dedicated-command-and-mode-line-wi.patch >From dc02ad0891c3a832617d6b234bd30a0bc8f8ef69 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Sat, 19 Aug 2023 16:01:54 -0400 Subject: [PATCH] Add toggle-window-dedicated command and mode-line-window-dedicated It's sometimes useful to interactively make certain windows dedicated. This allows a level of interactive control over which window display-buffer uses. Additionally, when a window is dedicated (even without this new command) it can affect display-buffer behavior in ways which may be unexpected for users. Let's display the window dedicated status in the mode-line to help indicate what's going on. * doc/emacs/windows.texi (Displaying Buffers): Add information about dedicated windows and toggle-window-dedicated. * etc/NEWS: Announce the mode-line-window-dedicated and toggle-window-dedicated. * lisp/window.el (toggle-window-dedicated): Add. (window-prefix-map): Add C-x w d binding. * lisp/bindings.el (mode-line-window-control): Add. (mode-line-window-dedicated): Add. (standard-mode-line-format): Insert mode-line-window-dedicated. --- doc/emacs/windows.texi | 16 ++++++++++++++++ etc/NEWS | 14 ++++++++++++++ lisp/bindings.el | 22 ++++++++++++++++++++++ lisp/window.el | 28 ++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+) diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index e4abdef76be..f24ffc20464 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi @@ -411,6 +411,22 @@ Displaying Buffers window on some other frame to display the desired buffer. Several of these commands are bound in the @kbd{C-x 5} prefix key. + Sometimes, a window is ``dedicated'' to its current buffer. +@code{display-buffer} will avoid reusing dedicated windows most of the +time. This is indicated by a ``d'' in the mode line. A window can +also be strongly dedicated, which prevents any changes to what buffer +that window displays; this is indicated by a ``D'' in the mode line. + +Usually, dedicated windows are used to display specialized buffers, +but dedication can sometimes be useful to interactively control +@code{display-buffer}'s window choices. + +@kindex C-x w d +@findex toggle-window-dedicated + Toggle whether the current window is dedicated to the current +buffer. With a prefix argument, make the window strongly dedicated +instead. + @menu * Window Choice:: How @code{display-buffer} works. * Temporary Displays:: Displaying non-editable buffers. diff --git a/etc/NEWS b/etc/NEWS index 3cfc36e10da..6368d640fb7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -92,6 +92,20 @@ plus, minus, check-mark, start, etc. The 'tool-bar-position' frame parameter can be set to 'bottom' on all window systems other than Nextstep. ++++ +** 'd' in the mode line now indicates that the window is dedicated. +Windows have always been able to be dedicated to a specific buffer; +see 'window-dedicated-p'. Now the mode line indicates the dedicated +status of a window, with 'd' appearing in the mode line if a window is +dedicated and 'D' if the window is strongly dedicated. + ++++ +** New command 'toggle-window-dedicated'. +This makes it easy to interactively mark a specific window as +dedicated, so it won't be reused by 'display-buffer'. This can be +useful for complicated window setups. It is bound to 'C-x w d' +globally. + ** cl-print *** You can expand the "..." truncation everywhere. The code that allowed "..." to be expanded in the *Backtrace* should diff --git a/lisp/bindings.el b/lisp/bindings.el index f1a75b080be..b751fed22ce 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -298,6 +298,27 @@ mode-line-frame-identification ;;;###autoload (put 'mode-line-frame-identification 'risky-local-variable t) +(defun mode-line-window-control () + "Compute mode line construct for window dedicated state. +Value is used for `mode-line-window-dedicated', which see." + (cond + ((eq (window-dedicated-p) t) + '(:propertize + " D" + help-echo "Window is strongly dedicated to current buffer" + mouse-face 'mode-line-highlight)) + ((window-dedicated-p) + '(:propertize + " d" + help-echo "Window is dedicated to current buffer" + mouse-face 'mode-line-highlight)) + (t ""))) + +(defvar mode-line-window-dedicated '(:eval (mode-line-window-control)) + "Mode line construct to describe the current window.") +;;;###autoload +(put 'mode-line-window-dedicated 'risky-local-variable t) + (defvar-local mode-line-process nil "Mode line construct for displaying info on process status. Normally nil in most modes, since there is no process to display.") @@ -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 " " diff --git a/lisp/window.el b/lisp/window.el index d91bbabc010..259c1e679ac 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7463,6 +7463,33 @@ display-buffer-mark-dedicated The actual non-nil value of this variable will be copied to the `window-dedicated-p' flag.") +(defun toggle-window-dedicated (&optional window flag interactive) + "Toggle whether WINDOW is dedicated. + +See `set-window-dedicated-p' for more details. WINDOW defaults +to the currently selected window. FLAG defaults to +`dedicated' (weak dedication) or `t' (strong dedication) with a +prefix argument. If INTERACTIVE is non-nil, will print a message +about the dedication status of the window afterwards." + (interactive "i\nP\np") + (setq window (window-normalize-window window)) + (setq flag (cond + ((consp flag) t) + ((null flag) 'dedicated) + (t flag))) + (if (window-dedicated-p window) + (set-window-dedicated-p window nil) + (set-window-dedicated-p window flag)) + (when interactive + (message "Window is %s dedicated to buffer %s" + (let ((status (window-dedicated-p window))) + (cond + ((null status) "no longer") + ((eq status t) "now strongly") + (t "now"))) + (current-buffer)) + (force-mode-line-update))) + (defconst display-buffer--action-function-custom-type '(choice :tag "Function" (const :tag "--" ignore) ; default for insertion @@ -10746,6 +10773,7 @@ window-prefix-map "2" #'split-root-window-below "3" #'split-root-window-right "s" #'window-toggle-side-windows + "d" #'toggle-window-dedicated "^ f" #'tear-off-window "^ t" #'tab-window-detach "-" #'fit-window-to-buffer -- 2.41.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 19 16:06:26 2023 Received: (at 64619) by debbugs.gnu.org; 19 Aug 2023 20:06:26 +0000 Received: from localhost ([127.0.0.1]:52353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXSDJ-000124-Te for submit@debbugs.gnu.org; Sat, 19 Aug 2023 16:06:26 -0400 Received: from s.wrqvtzvf.outbound-mail.sendgrid.net ([149.72.126.143]:39268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXSDH-00011q-IN for 64619@debbugs.gnu.org; Sat, 19 Aug 2023 16:06:24 -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=3hNCndPIiaDQcfS0FhWHQdte1k5HfzrXAI/xUPWJKHw=; b=Dcwk2CzM8mqLj5kUUzqPNLJb8Pt+jdIPEoKdKGsnIkuJG0L4V8Ub7QBph1nN3S9CKh2z uYhuUWeb//qFm+fegIu5E9DgImtOl0jHlDKhxndU0QSmyil3kFrPA2m2NMH9dhawgnnFEp ONfdv74qC9QWKWzCCS14Cs5qRYCMt4nUM5gqdPAV+4Hcd5/aRxR9zQ1HtU3JFY7RInE80s gMVnnxzPVfxjlHMHM3pUK+FZvvcmN9NtU1eP+8ka1misgoWdYTW1CdfE2Een6HG2669wJg OrlnweNyODS1yOvNK14yvGjDzwj29ACSe2N3Vv/Adb8P9bZ8cwS77X2++waS6O2A== Received: by filterdrecv-d7bbbc8bf-nxr9l with SMTP id filterdrecv-d7bbbc8bf-nxr9l-1-64E120B8-A 2023-08-19 20:06:16.578461895 +0000 UTC m=+8713598.664195316 Received: from earth.catern.com (unknown) by geopod-ismtpd-32 (SG) with ESMTP id rVeQPGoDS7W0V0v16xr8SQ Sat, 19 Aug 2023 20:06:16.421 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=heytings.org Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 0AE2862566; Sat, 19 Aug 2023 16:06:16 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <387ee04aa9601b936ac5@heytings.org> (Gregory Heytings's message of "Sat, 19 Aug 2023 16:43:15 +0000") References: <87h6ovgnpn.fsf@catern.com> <387ee04aa9601b936ac5@heytings.org> Date: Sat, 19 Aug 2023 20:06:16 +0000 (UTC) Message-ID: <87350ere4n.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbJEB53UFDEXCJZNkpipgC?= =?us-ascii?Q?FFYnIA1Rug3AHvbOqvLE0JiKo1qIONWY0T2z7dU?= =?us-ascii?Q?diLmdv1LgBOVLP=2FhKYvZpV2AQ4DdBSsJ5WepEI3?= =?us-ascii?Q?b=2FADLx=2FYcWWn=2FmnIvfEx7NadmUs0tWjkb8srw29?= =?us-ascii?Q?Yfb5NpyODIl=2FcjbLsy1OPqHYq=2F3ohozh=2FoQ=3D=3D?= To: Gregory Heytings X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Gregory Heytings writes: >>> OK, this patch adds support for making the buffer strongly >>> dedicated with a prefix argument, and also adds an indicator to the >>> mode line of whether the current window is dedicated (which s [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [149.72.126.143 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Debbugs-Envelope-To: 64619 Cc: Spencer Baugh , Philip Kaludercic , 64619@debbugs.gnu.org, martin rudalics , Eli Zaretskii , Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) Gregory Heytings writes: >>> OK, this patch adds support for making the buffer strongly >>> dedicated with a prefix argument, and also adds an indicator to the >>> mode line of whether the current window is dedicated (which seems >>> useful even if we don't apply the toggle part of this patch). >> >> Any thoughts on this patch? >> > > Two thoughs: > > 1. I would simplify the body of toggle-window-dedicated, using > > (set-window-dedicated-p window (not (window-dedicated-p))) > > This makes the window "strongly" dedicated, which is more in line with > what "Window will now display only its current buffer" promises > (e.g. C-x b will refuse to switch to another buffer). Ah, see earlier discussion. We at least want to be able to choose between strong and non-strong dedication. And having used this command I think non-strong dedication is a much better default, since it allows users to explicitly run C-x b to change buffers without having to switch off dedication. > 2. I would not bind it to the "d" key but to the "!" key: ISTM that > toggling window dedication is not such a common action that it needs a > letter key binding. It's not common at the moment, but I expect some users will use this command quite frequently. Also the C-x w prefix is pretty empty at the moment, so it's not as if it's competing with anything. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 19 16:37:41 2023 Received: (at 64619) by debbugs.gnu.org; 19 Aug 2023 20:37:41 +0000 Received: from localhost ([127.0.0.1]:52358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXShY-0001xH-Rd for submit@debbugs.gnu.org; Sat, 19 Aug 2023 16:37:41 -0400 Received: from heytings.org ([95.142.160.155]:45292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXShT-0001x4-5z for 64619@debbugs.gnu.org; Sat, 19 Aug 2023 16:37:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1692477452; bh=BQ+3v90H+TofVlKI++//BrG9PL4Et+Q/4l9MrqdLGu0=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=MiprR/O4Dd7Tt0Z219gl3kBoCdbYH856pbJuyB6uOlfbhaYzxtiwilqfrGNpfSnQZ asrAcWQbGHDPjOiKHO5KXnQBEUmOERzxozXPH9JMynVXIb/vI/Ih2lndtNTP+cFBqi XAbSMD0lP5Eq7bfsIyL2iXGV143HyMk+CES7+UrGDMAWn/DlP2TSUFm4z9SPW2bGLF HVZ7gCO7I38gaAxqBZtmnv6QlDzwET9YcX6+FOJBj4+bzXLE4MO5Eark4piSd07bZB TORm6OzMu0Nam8JuL5zN1Xb0nyFANOIvPDiUl/ud435AZTKy+gQ9+KjPQMWHrJmOjG 6Wr5Y/hXNBzVA== Date: Sat, 19 Aug 2023 20:37:31 +0000 From: Gregory Heytings To: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <87350ere4n.fsf@catern.com> Message-ID: <387ee04aa97c3477c4f3@heytings.org> References: <87h6ovgnpn.fsf@catern.com> <387ee04aa9601b936ac5@heytings.org> <87350ere4n.fsf@catern.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: Spencer Baugh , Philip Kaludercic , 64619@debbugs.gnu.org, martin rudalics , Eli Zaretskii , Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> This makes the window "strongly" dedicated, which is more in line with >> what "Window will now display only its current buffer" promises (e.g. >> C-x b will refuse to switch to another buffer). > > Ah, see earlier discussion. > Sorry, I missed that in the earlier discussion. > > We at least want to be able to choose between strong and non-strong > dedication. And having used this command I think non-strong dedication > is a much better default, since it allows users to explicitly run C-x b > to change buffers without having to switch off dedication. > I agree with Drew here: strong dedication would be a better default. The fact that the window was weakly dedicated and that I could switch to another buffer without any warning or confirmation surprised me when I tried your patch, hence my reaction. Dedicating a window to a buffer is somewhat like making a buffer read-only, and I guess "weak read-onlyness" would be surprising to most users. >> 2. I would not bind it to the "d" key but to the "!" key: ISTM that >> toggling window dedication is not such a common action that it needs a >> letter key binding. > > It's not common at the moment, but I expect some users will use this > command quite frequently. Also the C-x w prefix is pretty empty at the > moment, so it's not as if it's competing with anything. > It's pretty empty, but IMO that's not a reason to use its "best" bindings for something like this. "d" should IMO be used for "delete" (yes, I know it's already available with C-x 0). See https://lists.gnu.org/archive/html/emacs-devel/2022-09/msg00326.html. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 19 17:47:49 2023 Received: (at 64619) by debbugs.gnu.org; 19 Aug 2023 21:47:49 +0000 Received: from localhost ([127.0.0.1]:52412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXTnQ-0003fz-Ko for submit@debbugs.gnu.org; Sat, 19 Aug 2023 17:47:49 -0400 Received: from s.wrqvtzvf.outbound-mail.sendgrid.net ([149.72.126.143]:28852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXTnO-0003fD-NX for 64619@debbugs.gnu.org; Sat, 19 Aug 2023 17:47:47 -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=QSkoaXSPeT5vAp3pYsbCHRFb/Ekq30BcSB/oClu1uJ4=; b=FByL8sxUO3VOjsGQEanAV6rI6deiG/ESmsPRK5NsVl7tKvGwu97SuJUBRbMRQmBzK+ju mRmE8fUPBvoSVhyWv78xD4Ypxehj+JPU+35yEhiHqWk5w2+kpVvWzBAs1J6Mn6guK3lNYh +cMWs9E+/sXGJJ6sVUrLKV0SzoEYF3YjKfRu+rhfvzYuvLyU4zASxpUGKwXZihGZmuJERM ealrO6LHE2TEvZw/tc6PrAbpbVNzstXVyN7b68AVmRL0kN+ZURhJLVmKDr3Nry7nyzCqDV LqJJDp0GNwhACFIv4w5EYwgyJxRjSX7EYN74/gJ7ie3NIWNqE5cBt8DTxZ3WnPSg== Received: by filterdrecv-canary-56575c7785-wd5jg with SMTP id filterdrecv-canary-56575c7785-wd5jg-1-64E1387B-1 2023-08-19 21:47:39.126107348 +0000 UTC m=+8719767.907610797 Received: from earth.catern.com (unknown) by geopod-ismtpd-20 (SG) with ESMTP id 8hRVkiNvS4yUTgVTIgyNyQ Sat, 19 Aug 2023 21:47:38.802 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=heytings.org Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 7F64D6009C; Sat, 19 Aug 2023 17:47:38 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <387ee04aa97c3477c4f3@heytings.org> (Gregory Heytings's message of "Sat, 19 Aug 2023 20:37:31 +0000") References: <87h6ovgnpn.fsf@catern.com> <387ee04aa9601b936ac5@heytings.org> <87350ere4n.fsf@catern.com> <387ee04aa97c3477c4f3@heytings.org> Date: Sat, 19 Aug 2023 21:47:39 +0000 (UTC) Message-ID: <87zg2mpuv9.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbJ8Oemg2SB5x93TJMY2m5?= =?us-ascii?Q?R8HctOgkeZjJuhdbc4KGYqj=2FeeFze7RzNj4Gh=2FZ?= =?us-ascii?Q?lUP=2F1NYt7nziobqSGTDGCsyMbQf1nFlClPDABMP?= =?us-ascii?Q?8uFGRPk4QOPHin8LsBndsaN0aiuy9pj8f0uptOJ?= =?us-ascii?Q?mVZ=2FjCpYN16tzPFkg=2FUfBa10N7fp6d=2FJ=2F3XwDWt?= =?us-ascii?Q?=2FFcn5CQ1IHQDT63Po=3D?= To: Gregory Heytings X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Gregory Heytings writes: > I agree with Drew here: strong dedication would be a better default. > The fact that the window was weakly dedicated and that I could switch > to anot [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [149.72.126.143 listed in wl.mailspike.net] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Debbugs-Envelope-To: 64619 Cc: Spencer Baugh , Philip Kaludercic , 64619@debbugs.gnu.org, martin rudalics , Eli Zaretskii , Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) Gregory Heytings writes: > I agree with Drew here: strong dedication would be a better default. > The fact that the window was weakly dedicated and that I could switch > to another buffer without any warning or confirmation surprised me > when I tried your patch, hence my reaction. Dedicating a window to a > buffer is somewhat like making a buffer read-only, and I guess "weak > read-onlyness" would be surprising to most users. Maybe it's surprising to Emacs developers, but I think strong dedication would be more surprising to users. In fact, I initially used strong dedication in my patch. But I found it annoying that I had to turn off strong dedication explicitly if I wanted to switch to another buffer. That's what made me realize that weak dedication was better. Strong dedication would make sense if C-x b used display-buffer. Then it would be very helpful: C-x b in a strongly dedicated window would automatically use another window, which would be nice for muscle memory since you could just use C-x b regardless of what window you're in. But C-x b doesn't use display buffer, and instead just errors when the current window is strongly dedicated, which I think is fairly useless behavior; the user reaction is almost always going to be annoyance followed by C-x w d and C-x b again. So I think weak dedication is better. (Or making C-x b use display-buffer?) >>> 2. I would not bind it to the "d" key but to the "!" key: ISTM that >>> toggling window dedication is not such a common action that it >>> needs a letter key binding. >> >> It's not common at the moment, but I expect some users will use this >> command quite frequently. Also the C-x w prefix is pretty empty at >> the moment, so it's not as if it's competing with anything. >> > > It's pretty empty, but IMO that's not a reason to use its "best" > bindings for something like this. "d" should IMO be used for "delete" > (yes, I know it's already available with C-x 0). See > https://lists.gnu.org/archive/html/emacs-devel/2022-09/msg00326.html. Eh, I agree with others in that thread, I don't think C-x w d should run delete-buffer. :) But this does make me think that maybe toggle-window-dedicated should not have a default binding at first. We can see if people use it and only then give it a binding. I'm fine with that. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 19 18:36:53 2023 Received: (at 64619) by debbugs.gnu.org; 19 Aug 2023 22:36:53 +0000 Received: from localhost ([127.0.0.1]:52431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXUYv-0004uY-5w for submit@debbugs.gnu.org; Sat, 19 Aug 2023 18:36:53 -0400 Received: from heytings.org ([95.142.160.155]:45448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXUYr-0004uN-98 for 64619@debbugs.gnu.org; Sat, 19 Aug 2023 18:36:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1692484606; bh=N1Q8THxSDquVz0CdKZNIASZajTkcGYqyeKBmzpSaZvQ=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=ssoOyVLszpChWVDxaE2AzSexqcaQBWErixakBNYp0v8igROuD0wkvpB+oQa2u4/HI fQR2tLml2/iLMuumHkdeVJdFM88CKjdOYLXvJmFEmYf/zcwPN0kSFVz2nTKnDpfhrB DvqQXoYWI2x4Bv4Tt3bkPpSbs95sayhKoIbcEnncdJmzB8Uf4O8bRnYvk0tw/fnCpU lIUYTG6YR9Gq5o3QNTV9lMlYPWkDT8hbB0ATLU1XAi7luhMhDetK1NbZl9DMVneZN7 RW7NJCmECmixccSk2tp+5aJZ4r15NmlDUFDmXKmEeTppmrgvFCjN/gW5Lc2Smylc20 mM9ntNWi9lCNA== Date: Sat, 19 Aug 2023 22:36:45 +0000 From: Gregory Heytings To: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <87zg2mpuv9.fsf@catern.com> Message-ID: <387ee04aa9572975a3cd@heytings.org> References: <87h6ovgnpn.fsf@catern.com> <387ee04aa9601b936ac5@heytings.org> <87350ere4n.fsf@catern.com> <387ee04aa97c3477c4f3@heytings.org> <87zg2mpuv9.fsf@catern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: Spencer Baugh , Philip Kaludercic , 64619@debbugs.gnu.org, martin rudalics , Eli Zaretskii , Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > In fact, I initially used strong dedication in my patch. But I found it > annoying that I had to turn off strong dedication explicitly if I wanted > to switch to another buffer. That's what made me realize that weak > dedication was better. > It's not annoying, it's what dedication is for. It's not more annoying than using C-x C-q in a buffer, and later typing something in that buffer and realizing (with a similar error message) that it doesn't work: you get what you asked. > > But C-x b doesn't use display buffer, and instead just errors when the > current window is strongly dedicated, which I think is fairly useless > behavior; the user reaction is almost always going to be annoyance > followed by C-x w d and C-x b again. So I think weak dedication is > better. > If you think that's annoying, then I'd suggest setting the switch-to-buffer-in-dedicated-window configuration option. It's there for a reason, and you can select between no less than four behaviors: one of them is likely the one you want. > > Eh, I agree with others in that thread, I don't think C-x w d should run > delete-buffer. :) > I don't know which "others" you have in mind, I do recall that some disagreed (is there a single topic on emacs-devel on which no one disagrees?), but IIRC at least Lars said that it would be nice to have a full repertoire of commands to manage windows under C-x w. > > But this does make me think that maybe toggle-window-dedicated should > not have a default binding at first. We can see if people use it and > only then give it a binding. I'm fine with that. > I'm fine with that, too. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 20 01:57:25 2023 Received: (at 64619) by debbugs.gnu.org; 20 Aug 2023 05:57:25 +0000 Received: from localhost ([127.0.0.1]:52727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXbRE-0008IK-L1 for submit@debbugs.gnu.org; Sun, 20 Aug 2023 01:57:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXbRC-0008I3-K7 for 64619@debbugs.gnu.org; Sun, 20 Aug 2023 01:57:23 -0400 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 1qXbR3-0007lm-UD; Sun, 20 Aug 2023 01:57:13 -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=A/oQXpbzQKc38OGUSzHApJvBAuo4/CauqfL66LRvLOg=; b=k00ctsoXkGGR arOPqaOxE8gMsXc/fIrjC7wSPtXFW5KvIMbSSiyIXoecSu/Y1vGhrrssHmibC+izgdHlweKZB2iqP K662m1oyt3iNqw0w+aztbkEe2zpafEtvSg2CaTX3Iojst06C9uFYDzC7JSYyVweoo0eYV+GLK1eDl EXr6/4GR/C5411rIex4pYIZ9V5NJDVUS07AzOFcHzu5amdLTxRk8YGaEHP5is91VdTfUvrE3Wma7w g6P7oiqqNW/3wZcw0JZZtk+mzpu6k3roCI0Tj+9HxoMzngrpimGzwKIb8ES8Eho8tZhk/aIIYVoJm 6NSRkjbdUaS1q2oMQLLNog==; Date: Sun, 20 Aug 2023 08:57:26 +0300 Message-Id: <83il9axnll.fsf@gnu.org> From: Eli Zaretskii To: sbaugh@catern.com In-Reply-To: <877cpqreat.fsf@catern.com> (sbaugh@catern.com) Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command References: <87h6ovgnpn.fsf@catern.com> <874jkvvwm2.fsf@posteo.net> <87jztr0zt7.fsf@catern.com> <87zg2nuho0.fsf@posteo.net> <877cpqreat.fsf@catern.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: sbaugh@janestreet.com, philipk@posteo.net, 64619@debbugs.gnu.org, drew.adams@oracle.com, rudalics@gmx.at X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: sbaugh@catern.com > Date: Sat, 19 Aug 2023 20:02:35 +0000 (UTC) > Cc: Spencer Baugh , Eli Zaretskii , > martin rudalics , Drew Adams , > 64619@debbugs.gnu.org > > OK, added a NEWS entry and information in the manual. Thanks, a few comments, mainly to the documentation, below. > + Sometimes, a window is ``dedicated'' to its current buffer. Please add here a cross-reference to where dedicated windows are described in the ELisp manual. (This is our standard style of documentation: whenever we mention a feature or terminology explained elsewhere, we add a cross-reference there, unless one is already available nearby.) I would also add a @cindex entry here: @cindex dedicated window > +@code{display-buffer} will avoid reusing dedicated windows most of the > +time. This is indicated by a ``d'' in the mode line. And here there should be a cross-reference to where the mode line is described. > A window can > +also be strongly dedicated, which prevents any changes to what buffer > +that window displays; "...prevents any changes to the buffer displayed in the window" is easier to comprehend. > +Usually, dedicated windows are used to display specialized buffers, > +but dedication can sometimes be useful to interactively control > +@code{display-buffer}'s window choices. This text is not very useful. How about adding an example or two for when the user may wish to make a window dedicated, or make a dedicated window not dedicated? Then this command will make much more sense. > + > +@kindex C-x w d > +@findex toggle-window-dedicated > + Toggle whether the current window is dedicated to the current ^^^^^^^ "selected", not "current". Or maybe "currently-selected". We should also make changed in the section the describes the mode line, to include this indication there. > ++++ > +** 'd' in the mode line now indicates that the window is dedicated. > +Windows have always been able to be dedicated to a specific buffer; > +see 'window-dedicated-p'. Now the mode line indicates the dedicated > +status of a window, with 'd' appearing in the mode line if a window is > +dedicated and 'D' if the window is strongly dedicated. This should tell where on the mode line this indication will be shown. > +(defun mode-line-window-control () > + "Compute mode line construct for window dedicated state. > +Value is used for `mode-line-window-dedicated', which see." > + (cond > + ((eq (window-dedicated-p) t) > + '(:propertize > + " D" > + help-echo "Window is strongly dedicated to current buffer" > + mouse-face 'mode-line-highlight)) > + ((window-dedicated-p) > + '(:propertize > + " d" > + help-echo "Window is dedicated to current buffer" > + mouse-face 'mode-line-highlight)) > + (t ""))) Why not allow toggling the state by a mouse click, like we do with the buffer-writable indication? And the tooltip text is too long, I think. I suggest to use shorter text: Window dedicated to its buffer Window strongly dedicated to its buffer > @@ -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. > +(defun toggle-window-dedicated (&optional window flag interactive) > + "Toggle whether WINDOW is dedicated. > + > +See `set-window-dedicated-p' for more details. WINDOW defaults > +to the currently selected window. FLAG defaults to > +`dedicated' (weak dedication) or `t' (strong dedication) with a > +prefix argument. If INTERACTIVE is non-nil, will print a message > +about the dedication status of the window afterwards." This is a command, so the doc string must be detailed enough and user-friendly. Sending the user to read a doc string of another function is acceptable only if that other function is also a command (so that the doc string doesn't include too many technicalities), and if the description is very complicated in its user-facing parts. I don't think this is the case. My suggestion is to use the following doc string instead: Toggle whether WINDOW is dedicated to its current buffer. WINDOW must be a live window and defaults to the selected one. If FLAG is t (interactively, the prefix argument), make the window \"strongly\" dedicated to its buffer. FLAG defaults to a non-nil, non-t value, and is passed to `set-window-dedicated-p', which see. If INTERACTIVE is non-nil, print a message describing the dedication status of WINDOW, after toggling it. Interactively, this argument is always non-nil. When a window is dedicated to its buffer, `display-buffer' will avoid displaying another buffer in it, if possible. When a window is strongly dedicated to its buffer, changing the buffer shown in the window will usually signal an error. See the info node `(elisp)Dedicated Windows' for more details. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 20 02:13:20 2023 Received: (at 64619) by debbugs.gnu.org; 20 Aug 2023 06:13:20 +0000 Received: from localhost ([127.0.0.1]:52749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXbge-0000JR-8a for submit@debbugs.gnu.org; Sun, 20 Aug 2023 02:13:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXbgc-0000JD-I6 for 64619@debbugs.gnu.org; Sun, 20 Aug 2023 02:13:19 -0400 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 1qXbgU-0002Zz-CL; Sun, 20 Aug 2023 02:13:10 -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=1XDSzF5pl9g0TJud0LDXe7p26xwJoFnI3pXFWSy7M88=; b=ZmiLnyIr0Q61 PL7XFVCtCtNgRCOwO1EJN571dLko12CyK4xr/H0A/QknRi6L7jfeLiBD+TwhzJBCPtT3ChItne+B2 Q3U7UhhIZy7ruK7IIV/AyNHMLtqRKQ+XBT8GESwdaYD9YTkPgbQNV0NXRvGHNczhvLVIr3Wh1UniC DxcyOEi+Kh+LN9u/JcrAsQJ7NDb6WT4w4VoUaQcBL9TxteOsLoGMOxXOzTBNZfRq5QrdXOjQ1f7jy Cmk2tU0SH1FaiBAlp6IyKBKwcHIv3g5hN76ZBESMtA43aB20/uKQzMtUnDmN3C4Hjj2XFJpg9TDvy YlggiCrjuMEbqzAxqH6rwg==; Date: Sun, 20 Aug 2023 09:13:24 +0300 Message-Id: <83edjyxmuz.fsf@gnu.org> From: Eli Zaretskii To: Gregory Heytings In-Reply-To: <387ee04aa9572975a3cd@heytings.org> (message from Gregory Heytings on Sat, 19 Aug 2023 22:36:45 +0000) Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command References: <87h6ovgnpn.fsf@catern.com> <387ee04aa9601b936ac5@heytings.org> <87350ere4n.fsf@catern.com> <387ee04aa97c3477c4f3@heytings.org> <87zg2mpuv9.fsf@catern.com> <387ee04aa9572975a3cd@heytings.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 19 Aug 2023 22:36:45 +0000 > From: Gregory Heytings > cc: Spencer Baugh , > Philip Kaludercic , 64619@debbugs.gnu.org, > martin rudalics , Eli Zaretskii , > Drew Adams > > > > > > In fact, I initially used strong dedication in my patch. But I found it > > annoying that I had to turn off strong dedication explicitly if I wanted > > to switch to another buffer. That's what made me realize that weak > > dedication was better. > > > > It's not annoying, it's what dedication is for. It's not more annoying > than using C-x C-q in a buffer, and later typing something in that buffer > and realizing (with a similar error message) that it doesn't work: you get > what you asked. > > > > > But C-x b doesn't use display buffer, and instead just errors when the > > current window is strongly dedicated, which I think is fairly useless > > behavior; the user reaction is almost always going to be annoyance > > followed by C-x w d and C-x b again. So I think weak dedication is > > better. > > > > If you think that's annoying, then I'd suggest setting the > switch-to-buffer-in-dedicated-window configuration option. It's there for > a reason, and you can select between no less than four behaviors: one of > them is likely the one you want. I think the reason that people disagree about the details is because they have different use cases for this feature in mind. To reconcile these two opinions, we could introduce a user option which would invert the default: make strongly-dedicated the default and weekly-dedicated the optional kind requiring C-u. Alternatively, we could use switch-to-buffer-in-dedicated-window as that user option: if the user sets it non-nil, we could take that as an indication that they prefer the strongly-dedicated default. WDYT? From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 20 04:02:29 2023 Received: (at 64619) by debbugs.gnu.org; 20 Aug 2023 08:02:29 +0000 Received: from localhost ([127.0.0.1]:53040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXdOH-0003VL-Ep for submit@debbugs.gnu.org; Sun, 20 Aug 2023 04:02:29 -0400 Received: from heytings.org ([95.142.160.155]:45968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXdOG-0003VE-96 for 64619@debbugs.gnu.org; Sun, 20 Aug 2023 04:02:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1692518546; bh=PkaTbGw3nRppInFsPDDIPe9/hnh/pNLhDfTDWfvRRTg=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=MDZWNGsWyLxD+JGYtp859XI/WgXkyTgIPa3If07ixU9M4J8jPFcdnsMabDxGZrWyw Ek7buxbvuRISd0PNRrs+b/N71lr45Ushvwn3H9SgpQnBOo9SmB2WekqXsPDjjLgxtk 2b0aJuMMNm9e4Ah+rSP00w3VEiJFLoEGz1DY83jFgkzXuIdzBLnToswX49ntJmrLDF bqljMDCcfqKiYR/mZ/EJB01S/32M+yQ8Bh+d3KaOu9Cz8LNKgafmoLpEKS4iQmFenA M3znW/766noyLWDrHtK5W2ktBvZ+LghpgmBjHr5PnVvYrNzuwPaMP8hC1FHucd4P2e FSvQZavVmcQKw== Date: Sun, 20 Aug 2023 08:02:25 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <83edjyxmuz.fsf@gnu.org> Message-ID: <22de08b62bd05dc884c9@heytings.org> 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> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > Alternatively, we could use switch-to-buffer-in-dedicated-window as that > user option: if the user sets it non-nil, we could take that as an > indication that they prefer the strongly-dedicated default. > IMO it would be much cleaner to just strongly dedicate the window in toggle-window-dedicated, and to add a note in its docstring pointing to switch-to-buffer-in-dedicated-window and explaining that that option should be used to decide what happens with C-x b. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 20 04:30:51 2023 Received: (at 64619) by debbugs.gnu.org; 20 Aug 2023 08:30:51 +0000 Received: from localhost ([127.0.0.1]:53055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXdpi-0004C1-Ov for submit@debbugs.gnu.org; Sun, 20 Aug 2023 04:30:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXdpf-0004Bm-Be for 64619@debbugs.gnu.org; Sun, 20 Aug 2023 04:30:50 -0400 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 1qXdpW-0003we-TS; Sun, 20 Aug 2023 04:30:38 -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=XwezlNkaeAryOLphYJYp3UNaBhePSb4yr2LSxdr5Gz8=; b=BX+LDQJoGsyJ LoSlM0fIiX6p4uHNagi/6+GjeXVoEPOEzOadFN40eaxGc8pJwkJj7G0zcvdLlMRbLIyHKMzoobo2q /OLU+O/eFMtNvxiunj7n157mbhA+OL0o63zDhkC7dWc8KbtOnhrdzMepfYHhx3mhX4RRy81fGeQ+d l2pWfYEXmHXvhBaJQVXfaj0o6m8Ix+mv4NRcf78G7ZeAzZZkK5PWD5X3uYzZx0p18CIMTroSUJH9T QnLzwf6KKE9HHlKoRausxixcSqRE0YiXQ64It01/gA0k2aUs642oTV6a5aV7hV3E0ORAYwhR0hxzF N4tHnEGP5iqLRvRlb7CVMg==; Date: Sun, 20 Aug 2023 11:30:52 +0300 Message-Id: <83wmxqw1xf.fsf@gnu.org> From: Eli Zaretskii To: Gregory Heytings In-Reply-To: <22de08b62bd05dc884c9@heytings.org> (message from Gregory Heytings on Sun, 20 Aug 2023 08:02:25 +0000) Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 20 Aug 2023 08:02:25 +0000 > From: Gregory Heytings > cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, > sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com > > > Alternatively, we could use switch-to-buffer-in-dedicated-window as that > > user option: if the user sets it non-nil, we could take that as an > > indication that they prefer the strongly-dedicated default. > > IMO it would be much cleaner to just strongly dedicate the window in > toggle-window-dedicated, and to add a note in its docstring pointing to > switch-to-buffer-in-dedicated-window and explaining that that option > should be used to decide what happens with C-x b. So you are saying that opinions of people who disagree with you should be simply disregarded? From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 20 04:41:58 2023 Received: (at 64619) by debbugs.gnu.org; 20 Aug 2023 08:41:58 +0000 Received: from localhost ([127.0.0.1]:53069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXe0U-0004S3-EW for submit@debbugs.gnu.org; Sun, 20 Aug 2023 04:41:58 -0400 Received: from heytings.org ([95.142.160.155]:46036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXe0P-0004Rq-JE for 64619@debbugs.gnu.org; Sun, 20 Aug 2023 04:41:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1692520911; bh=bxZ0kdz7n4AwKw/nBsj2eB/r/PK9hifyMSMWafTrSbE=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=YmB0zgJ/CrgpCIz7y4zxTMiDSzmL74CR0dVmzneFV+L2nASvFJYq8GCrE4ARvoUuf uUccC/03+TkR1jvsOSDDaP61QFgc2IflLFWmPhPAHb5ntvA9lrSTBN3W3NwHzDD98v u4pqqIQfERa1mGDrRWyKyU9195IvRD0YLTXfOSRfg9SHpZ+YUENC0a8mbYhpxmv4EV SaO5PeFI5LfawbN5kd+QS2ZSfUARKt62u+4zv0kYvLifxlwm+hZKiWcilO/pYBuobb BLVqL8JW/6RYa3WwcqT26CtL5z47GoX5/LyPsbvW7nJxegH6J62JduzzAdNWP3q7KK 7lv/Pg/2EMYgw== Date: Sun, 20 Aug 2023 08:41:50 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <83wmxqw1xf.fsf@gnu.org> Message-ID: <22de08b62bfcc659fbd6@heytings.org> 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> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>> Alternatively, we could use switch-to-buffer-in-dedicated-window as >>> that user option: if the user sets it non-nil, we could take that as >>> an indication that they prefer the strongly-dedicated default. >> >> IMO it would be much cleaner to just strongly dedicate the window in >> toggle-window-dedicated, and to add a note in its docstring pointing to >> switch-to-buffer-in-dedicated-window and explaining that that option >> should be used to decide what happens with C-x b. > > So you are saying that opinions of people who disagree with you should > be simply disregarded? > Hmmm... no. Where do you see that? I'm simply saying that a user option to control how C-x b behaves with a (strongly) dedicated window already exists, which means that the behavior that Spencer found annoying can already be tweaked, and that it is not necessary to add yet another user option to control that behavior. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 20 04:54:38 2023 Received: (at 64619) by debbugs.gnu.org; 20 Aug 2023 08:54:38 +0000 Received: from localhost ([127.0.0.1]:53089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXeCj-0004ri-JD for submit@debbugs.gnu.org; Sun, 20 Aug 2023 04:54:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXeCh-0004rM-0a for 64619@debbugs.gnu.org; Sun, 20 Aug 2023 04:54:36 -0400 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 1qXeCY-0008EP-Ki; Sun, 20 Aug 2023 04:54:26 -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=hF/7rUmaJiWG3W6fIT/Q6+SWFZ+PWtxAe8h/3yy3QaM=; b=BTDTyS5eJnA6 M/80qEVQijrHrJsYpeQE5CpQPvQGSvgMvElQEkhGmHxif6UzS52dumGVkFvUtf6v6KRF3ifOvCNXf vBBQEmATBboCy524KE7GHK6+xV2srwlfvbncOZMN/b9YAKFq3sfIs7cU06+YsXA5KCVVmTYEGIS4C BnniGBgDBEKsJ2y8R2MoS2dvjj/aJHbwpy12bAyfXfkB7ZQITw/fh25og/D3MQLnI1KXKeokaCuuB JJSddMndJ4Mwp52c8Ovj0bm7O+qMzjSjNCGvL1NEf/0kXUFH6fAI6qdvbT6GOYXJMPEGrreY2At2m bvvdSKA26JbCYw/2/Rpwmg==; Date: Sun, 20 Aug 2023 11:54:40 +0300 Message-Id: <83ttsuw0tr.fsf@gnu.org> From: Eli Zaretskii To: Gregory Heytings In-Reply-To: <22de08b62bfcc659fbd6@heytings.org> (message from Gregory Heytings on Sun, 20 Aug 2023 08:41:50 +0000) Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 20 Aug 2023 08:41:50 +0000 > From: Gregory Heytings > cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, > sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com > > >> IMO it would be much cleaner to just strongly dedicate the window in > >> toggle-window-dedicated, and to add a note in its docstring pointing to > >> switch-to-buffer-in-dedicated-window and explaining that that option > >> should be used to decide what happens with C-x b. > > > > So you are saying that opinions of people who disagree with you should > > be simply disregarded? > > Hmmm... no. Where do you see that? I'm simply saying that a user option > to control how C-x b behaves with a (strongly) dedicated window already > exists, which means that the behavior that Spencer found annoying can > already be tweaked, and that it is not necessary to add yet another user > option to control that behavior. A user who didn't customize switch-to-buffer-in-dedicated-window does not necessarily want his/her dedicated windows to be strongly dedicated by default. Which is why one of the alternatives I suggested is to use the value of that variable as the indication which kind of dedication to use by default. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 20 05:56:13 2023 Received: (at 64619) by debbugs.gnu.org; 20 Aug 2023 09:56:13 +0000 Received: from localhost ([127.0.0.1]:53108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXfAK-0006Sf-Tr for submit@debbugs.gnu.org; Sun, 20 Aug 2023 05:56:13 -0400 Received: from heytings.org ([95.142.160.155]:46106) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXfAI-0006SV-5M for 64619@debbugs.gnu.org; Sun, 20 Aug 2023 05:56:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1692525367; bh=AcA9vb/WWomV694KXUyszlUgnDTUHCQn09M1D/Wem7I=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=quUwP/XMOwTc3siT9oBihMrA8qYTb6QhzOcSLVZVKX4b5I1dqKVmlC7Xcvr4/W+fl GLie75cIfiHQiF+dhK7Tq2faNb++3oC1Pxe1YU/LCelzG8vKPAYQwNFiZjgUaME/uI rWsYgIqmBvy0WTsshETFpD0KQr0mwd7U+k0vqzviTF/ArsKg9xsIo/A5aCRKM23zR+ xOWyqEurXWSFYbaz6Y3ypbWtIveC0uDm+pngC9bGalOAE9ZSonb+FPRuw83ZaNMJKJ Uhhwi5k5hYFS0UDu0ez/SUxMctlp7xYpMqSyk2hkXmYhc3XiE/9uGHsm7jbb+/Azlw ld5Hdslu4Xm8Q== Date: Sun, 20 Aug 2023 09:56:06 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <83ttsuw0tr.fsf@gnu.org> Message-ID: <22de08b62b6d15a880af@heytings.org> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > A user who didn't customize switch-to-buffer-in-dedicated-window does > not necessarily want his/her dedicated windows to be strongly dedicated > by default. Which is why one of the alternatives I suggested is to use > the value of that variable as the indication which kind of dedication to > use by default. > That wouldn't really work, alas. The mapping would be: switch-to-buffer-in-dedicated-window t => weakly dedicated switch-to-buffer-in-dedicated-window non-t => strongly dedicated Weakly dedicating a window when switch-to-buffer-in-dedicated-window is t is not really useful. And the default value of switch-to-buffer-in-dedicated-window is nil, so the default would be strongly dedicated anyway. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 20 06:11:44 2023 Received: (at 64619) by debbugs.gnu.org; 20 Aug 2023 10:11:44 +0000 Received: from localhost ([127.0.0.1]:53123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXfPM-0006pj-DA for submit@debbugs.gnu.org; Sun, 20 Aug 2023 06:11:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXfPK-0006pY-RX for 64619@debbugs.gnu.org; Sun, 20 Aug 2023 06:11:43 -0400 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 1qXfPC-0005Ms-R1; Sun, 20 Aug 2023 06:11:34 -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=DJEhBXkkCgl14rD63iQWSp0iVPjRA0uQXoWuL26NEs4=; b=hZHKcrbM0Z7b preZ1wIfleFGSV+kYAtUTS/Ks3kONGqCHERCw3ZhwQZSntfFUHG9dfkKunMAQUVdg2tzqPbo2hUKR xeTqenoKfbUYAJy6G9q9fggo08qeivQS6e9K9S18icEJikOnkCJYg7i6db5inGNBuFUQJB/yVkf/G TReyupveDMbkofUi4pwcuJDEiw6ziz0MiXJOpR53HCJzdkjHSe5OeIwG6UMPMr+/mcChU87IcvhoL 1AaQup7b0F4UyYi3C3zdBFAaenmXaXXXnikwDhd4/31bvrqF+OkW6YQj4JgpUcTfsGZjzZqnLIB7n 7i3WHWB8FZc9N09OOAc5/A==; Date: Sun, 20 Aug 2023 13:11:47 +0300 Message-Id: <83sf8evx98.fsf@gnu.org> From: Eli Zaretskii To: Gregory Heytings In-Reply-To: <22de08b62b6d15a880af@heytings.org> (message from Gregory Heytings on Sun, 20 Aug 2023 09:56:06 +0000) Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 20 Aug 2023 09:56:06 +0000 > From: Gregory Heytings > cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, > sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com > > > A user who didn't customize switch-to-buffer-in-dedicated-window does > > not necessarily want his/her dedicated windows to be strongly dedicated > > by default. Which is why one of the alternatives I suggested is to use > > the value of that variable as the indication which kind of dedication to > > use by default. > > That wouldn't really work, alas. The mapping would be: > > switch-to-buffer-in-dedicated-window t => weakly dedicated > > switch-to-buffer-in-dedicated-window non-t => strongly dedicated I meant the opposite mapping, actually. > Weakly dedicating a window when switch-to-buffer-in-dedicated-window is t > is not really useful. And the default value of > switch-to-buffer-in-dedicated-window is nil, so the default would be > strongly dedicated anyway. There's an inherent problem with using switch-to-buffer-in-dedicated-window for this purpose anyway: it doesn't necessarily allow switch-to-buffer to change the buffer in such a window, it might ask the user whether to switch, and the window is no longer dedicated if the switch takes place. So I don't think this variable can serve the user preference for whether the window should be strongly or weekly dedicated by default. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 20 06:25:13 2023 Received: (at 64619) by debbugs.gnu.org; 20 Aug 2023 10:25:13 +0000 Received: from localhost ([127.0.0.1]:53142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXfcP-0007G3-97 for submit@debbugs.gnu.org; Sun, 20 Aug 2023 06:25:13 -0400 Received: from heytings.org ([95.142.160.155]:46166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXfcN-0007Fv-Gn for 64619@debbugs.gnu.org; Sun, 20 Aug 2023 06:25:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1692527108; bh=8dop2bfW7nT0Ak1hG5H/ZFooIh5Y8km8NdSjl6OU+w0=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=BWzdZmN/82shNz8FsEeihIikwCaE0NZBQrzLLQE/FCI3p8UhHSK22KS+dBQikezpD HKSPXyH47vagP+joDsJyFxHEBDgQrqz1m5jI4Ay+bGdfQBYrMlL9chyzxe/208s9gU JmywjJtfIs9d2axNUjUqikseez3zvLbA/p9GPZyWXdGTRo2gR7h+mmMxqdgsEvv4RJ 4KCiA7q2WCWqVxP/+I6phWhP4vNdu7gnaFcggS3OXVOaHKIOn3U4zxBhaePua1t1r2 LEoDUCWdrbB/QeRJRooDraPQodH49WBWfWjcljuQGk3mdn7rOTgeMR9oTzrnL4XMKa Z3KiHv37F8mLA== Date: Sun, 20 Aug 2023 10:25:08 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <83sf8evx98.fsf@gnu.org> Message-ID: <22de08b62b4b6e98a722@heytings.org> 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> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 20 10:09:44 2023 Received: (at 64619) by debbugs.gnu.org; 20 Aug 2023 14:09:44 +0000 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 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== 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 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 Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 553E262523; Sun, 20 Aug 2023 10:09:34 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <22de08b62b4b6e98a722@heytings.org> (Gregory Heytings's message of "Sun, 20 Aug 2023 10:25:08 +0000") 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> Date: Sun, 20 Aug 2023 14:09:35 +0000 (UTC) Message-ID: <87fs4dpzz5.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbLnegdj3HmpExqSBZSZPW?= =?us-ascii?Q?yL2AKsB1xXpC4Gnm=2F6wuZXpNx3535k8rg6HtAMP?= =?us-ascii?Q?+nESLAwD6wC9lTSiml97uFsgIiCP4rWaiaKtaFF?= =?us-ascii?Q?0BP5uhddab7WXwlxzszojoxZFpSJ=2FL7XJmqI7uU?= =?us-ascii?Q?bZtqtpFR+nphGsEWgE6WwexJ0yNuj=2FSxXeQ=3D=3D?= To: Gregory Heytings X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, rudalics@gmx.at, Eli Zaretskii , drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 20 11:31:40 2023 Received: (at 64619) by debbugs.gnu.org; 20 Aug 2023 15:31:40 +0000 Received: from localhost ([127.0.0.1]:54622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXkOy-0001po-Fc for submit@debbugs.gnu.org; Sun, 20 Aug 2023 11:31:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXkOv-0001pY-Eu for 64619@debbugs.gnu.org; Sun, 20 Aug 2023 11:31:38 -0400 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 1qXkOn-0002Dg-Jy; Sun, 20 Aug 2023 11:31:29 -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=ox/ftQUv1zS7jV47SDZh5zZA9U92hOocd+VVw5uP1xY=; b=TAayUDegIQ/x fsmB1XbX5rXssGD6LlZ9bv22z7OK3e8pXXwOEhntwE7IqWY1IWGJsVhNIqD6niwEdiMP2mWPljvbF glJhG9pyfT7bs3heuk6mLWBkZNFAJjBtOGd9KilXPyqivzgkUov4zwRJOosmOaEsXA1B9+twO6Ssb /0MxNBnL+0zoBo+T0MnNST/AkefgXuoAv0jCgTRL1ypXxcZbMTwMh/hVxJWM8AM0TuQSfDd48g1aj BlYL9NDCHuw3MTvYkw3/gCKC8n8vF4IsZP3eQO9hjs+JBG+19O8oiEi1Hxub59a3ndks3YjHOBrMc eSt6kuiX5KhLrTqG4ZxT4A==; Date: Sun, 20 Aug 2023 18:31:44 +0300 Message-Id: <83il99wx0f.fsf@gnu.org> From: Eli Zaretskii To: sbaugh@catern.com In-Reply-To: <87fs4dpzz5.fsf@catern.com> (sbaugh@catern.com) Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command 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> <87fs4dpzz5.fsf@catern.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, rudalics@gmx.at, gregory@heytings.org, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: sbaugh@catern.com > Date: Sun, 20 Aug 2023 14:09:35 +0000 (UTC) > Cc: Eli Zaretskii , 64619@debbugs.gnu.org, philipk@posteo.net, > sbaugh@janestreet.com, rudalics@gmx.at, drew.adams@oracle.com > > Completely separate suggestion and possible resolution: Maybe we can > have two commands, one which does weak dedication and the other strong > dedication? That'd be overkill, IMO. The single command is already borderline (since dedicated windows were not introduced as an interactive feature, but rather as a means for Lisp programs to control display-buffer's otherwise "wild West" type behavior). Having two commands is completely overboard. Let's not take this ad absurdum. (Of course, you can always have a special command in your local init file, if you need them both. Here we are talking about what the majority of Emacs users will need.) From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 20 17:56:51 2023 Received: (at 64619) by debbugs.gnu.org; 20 Aug 2023 21:56:51 +0000 Received: from localhost ([127.0.0.1]:55012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXqPj-0002xB-KF for submit@debbugs.gnu.org; Sun, 20 Aug 2023 17:56:51 -0400 Received: from heytings.org ([95.142.160.155]:46900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXqPi-0002x2-00 for 64619@debbugs.gnu.org; Sun, 20 Aug 2023 17:56:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1692568606; bh=Cy4rK70RA4EhgJtROuvYb+MTzcCjDcUdzE8bGM8dGNs=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=L7YwvSp96aPrXbvJWLoywQnkDJPWMTc0TMTLFIZ13OtfLhTCUE38OkZiQHo68/3VS VA4VIAp7/Oge5jlAsgMsAVtURa6Suw3/ZfhSb6JAi00HplXY57/+YwQpEpLe/IyaIg yFGXuF5julx6VsS+5GrboE8UjqUyCxbloZN3rRBR/P2Zpb4LUYqNRKiWyOYZSFhYfP myOQF+5y7wN8L5PBXat2AtHlxiJMoq58NRun41ulvLQ/wjK3xtapNHCWrw5B2APYpl SAd7XyzMZ6r2Co+G6C+lGYqysr+YaHQElRJauzXltveBGv8zx/a7HjsgQV7c/VnOQd TDTHGuNfWsADQ== Date: Sun, 20 Aug 2023 21:56:45 +0000 From: Gregory Heytings To: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <87fs4dpzz5.fsf@catern.com> Message-ID: <22de08b62b5a6672f446@heytings.org> 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> <87fs4dpzz5.fsf@catern.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, rudalics@gmx.at, Eli Zaretskii , drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > 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. > Great! > > But, it affects all windows, not just ones that have been interactively > dedicated by the user. > Indeed, that option is used for C-x b in all dedicated windows. > > 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. > It is wise to go into such refinements for a new command that, as Eli says, is a bit borderline? Right now window dedication is not even mentioned in the Emacs manual. Perhaps a new value for switch-to-buffer-in-dedicated-window, which would prompt the user and offer them the choice to either display the buffer in the current window or in another window, would be enough (and more generally useful)? From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 21 04:28:10 2023 Received: (at 64619) by debbugs.gnu.org; 21 Aug 2023 08:28:10 +0000 Received: from localhost ([127.0.0.1]:55497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY0Gg-0005ad-Dr for submit@debbugs.gnu.org; Mon, 21 Aug 2023 04:28:10 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:59887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY0Ge-0005aQ-Uu for 64619@debbugs.gnu.org; Mon, 21 Aug 2023 04:28:09 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-52a069edca6so1176306a12.3 for <64619@debbugs.gnu.org>; Mon, 21 Aug 2023 01:28:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692606481; x=1693211281; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=oSGcWY/1K9EDh0O1hKbC0q+BaFk/0LHgXQxBhz/SaXc=; b=awqy2JMTQZ65GxEXYNuSyQt1W5XmObHttBIgTVY0MXDlAdCzVnFNzBcMs4x52fbEDd KSoeXjYlfpkCxgeZTDcVD5wBApFkd87nX+x5yq0uWK7FzE4eORZypHrSeX83MNS8HbVN fmT7MOI1Hj35AmeTSnYYQ3y4MyZJV2trHnzFwwW5hyoPY2Z7cE/6JhLVo2h6UAs3HlED 8QLNCgc+A37E6dh8IFPjIMl4HDaN/ZMOzI3gj4sRy37JZcXXcoKahklkxEz8SfewCXrr U6E91Y85iZuyVGMmmsw8wv+G2yVMddqo2PRPtCoLxAUssyFmgJl3fgygUsKW/xFtI/aK yy5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692606481; x=1693211281; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oSGcWY/1K9EDh0O1hKbC0q+BaFk/0LHgXQxBhz/SaXc=; b=fsx+btOAxXt97svk9xxcLp6eMFag8uR3mMbYL9++z2x+QyZOvfzugZ1Ste9Tz95xkw HAIdphf0ieQHL5TNlTdiBERiwauL7FqO0oS32L11ifsUPH6Ou5K4Vs24vs6qwgeu6Zhz sjpWaeKWoVRWOWcPIwsWgP37cDm1zMuagY7V1x3l2M7aqzDCGnab6YqqL496TZnGmGeD /12gqHsl+4kPIB8mEexqsqOKWzyJTWKloShyZc9aRYORpZGs3yYLjQb6vGdjnYBw6VGb SwBkHBBrpAAZ8UmfEJcRDR63k/EWdwbyZ7qnC2uIJlqNhQ3llVWHLohpKQe++XsbxZ60 zmNA== X-Gm-Message-State: AOJu0YwaWcUyqtOpAAn1QZWvKm5aEl5StLPKA16FjDFBOJcU/yrzSpT8 C9EeqJF6plzrn4/q2VNYzjk= X-Google-Smtp-Source: AGHT+IHNcQsRcNkuRLjxUnJFC810XKWKSG7ONU0OrxuGasHmkHY9GGc2V2Z2iLO6VNhIo4v1s1ynAw== X-Received: by 2002:aa7:c507:0:b0:526:e585:e25a with SMTP id o7-20020aa7c507000000b00526e585e25amr4182576edq.38.1692606480855; Mon, 21 Aug 2023 01:28:00 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:6098::2fae]) by smtp.gmail.com with ESMTPSA id l2-20020aa7cac2000000b0052239012c65sm5655551edt.82.2023.08.21.01.27.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 01:27:59 -0700 (PDT) From: Augusto Stoffel To: Gregory Heytings Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <387ee04aa97c3477c4f3@heytings.org> (Gregory Heytings's message of "Sat, 19 Aug 2023 20:37:31 +0000") References: <87h6ovgnpn.fsf@catern.com> <387ee04aa9601b936ac5@heytings.org> <87350ere4n.fsf@catern.com> <387ee04aa97c3477c4f3@heytings.org> Date: Mon, 21 Aug 2023 10:27:58 +0200 Message-ID: <87o7j0yf3l.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, Philip Kaludercic , Spencer Baugh , sbaugh@catern.com, martin rudalics , Eli Zaretskii , Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sat, 19 Aug 2023 at 20:37, Gregory Heytings wrote: > It's pretty empty, but IMO that's not a reason to use its "best" > bindings for something like this. "d" should IMO be used for "delete" > (yes, I know it's already available with C-x 0). See > https://lists.gnu.org/archive/html/emacs-devel/2022-09/msg00326.html. Another candidate for the "d" command would be this one (which you called soft delete): https://yhetil.org/emacs-devel/84acc36e7edde6dee845@heytings.org/ (BTW, +1 for a "toggle dedicated window" command, I have something similar and think it's useful.) From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 21 07:23:28 2023 Received: (at 64619) by debbugs.gnu.org; 21 Aug 2023 11:23:28 +0000 Received: from localhost ([127.0.0.1]:55693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY30J-0004V6-QY for submit@debbugs.gnu.org; Mon, 21 Aug 2023 07:23:28 -0400 Received: from s.wrqvwxzv.outbound-mail.sendgrid.net ([149.72.154.232]:13186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY30H-0004Uu-Of for 64619@debbugs.gnu.org; Mon, 21 Aug 2023 07:23:26 -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=/wKbmBQaxWTrHMHGzuhrWDPPZ3EJw85vUoERXBurdz0=; b=Pmemfq1mzBarXiDPtjSxMQyUx0RR4RbOs9U4NaZyPPApPUqYIZybBykcm0dqeHyhdFYP Yp74T0PU7zbwZzKo7+clE1qkFMcgpwe5O0joJTuZqcCNxTP8uOzPdDbkj/RazIija2mX9v 1l+Ma+AfMx3pBotR8g8AyIi9Lpvu2PIyGwFa9XyHl58sVfB+PX7mMTNF1zoAqs35V8dI5g 95kNUOzvPkhNgN0aseRKTE/G1ca0g8SQqCOzwN+we9IGYifQ+PvHkS8DmelPn2h/5rMsek WgCCZK1tFyVdV9oRfOKHEos6GZOe5LDKpHAzLFDDcBByjYJNmubu0lfTP5ew4TMg== Received: by filterdrecv-66949dbc98-s5rnx with SMTP id filterdrecv-66949dbc98-s5rnx-1-64E34926-9 2023-08-21 11:23:18.062604894 +0000 UTC m=+2931646.312320751 Received: from earth.catern.com (unknown) by geopod-ismtpd-6 (SG) with ESMTP id uzMllQIKSU2trh6IaUGU_g Mon, 21 Aug 2023 11:23:17.948 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=heytings.org Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 8759160059; Mon, 21 Aug 2023 07:23:17 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <22de08b62b5a6672f446@heytings.org> (Gregory Heytings's message of "Sun, 20 Aug 2023 21:56:45 +0000") 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> <87fs4dpzz5.fsf@catern.com> <22de08b62b5a6672f446@heytings.org> Date: Mon, 21 Aug 2023 11:23:18 +0000 (UTC) Message-ID: <87bkf0prkq.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbIUxhLnwYHs7eVUgSkYbO?= =?us-ascii?Q?kGOvbuU0wpeUZdYVp=2FQPMqeYgxjHb5DhZpbXEXj?= =?us-ascii?Q?jdZcnREriadBMk8MX2KZq1QcgzBw5mycm+3KdW7?= =?us-ascii?Q?XeTPhTUayahj4PmKgZbGCX0rhHwbNDqZZ0RZ4LO?= =?us-ascii?Q?vZyL4YBUJ+LRLNMI6q1MmByXXN0tS2umhDw=3D=3D?= To: Gregory Heytings X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, rudalics@gmx.at, Eli Zaretskii , drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gregory Heytings writes: >> >> 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. >> > > Great! To be clear, as I said, I still don't think the existence of switch-to-buffer-in-dedicated-window means toggle-window-dedicated should default to weak dedication :) >> But, it affects all windows, not just ones that have been >> interactively dedicated by the user. >> > > Indeed, that option is used for C-x b in all dedicated windows. > >> >> 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. >> > > It is wise to go into such refinements for a new command that, as Eli > says, is a bit borderline? Right now window dedication is not even > mentioned in the Emacs manual. Perhaps a new value for > switch-to-buffer-in-dedicated-window, which would prompt the user and > offer them the choice to either display the buffer in the current > window or in another window, would be enough (and more generally > useful)? No "refinments" are necessary, this is exactly the behavior which is achieved by just using weak dedication, like the command in my patch currently does. I'm happy to make it customizable, though. I just believe the default should be weak dedication. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 21 09:01:01 2023 Received: (at 64619) by debbugs.gnu.org; 21 Aug 2023 13:01:01 +0000 Received: from localhost ([127.0.0.1]:55816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY4Wh-0003va-RP for submit@debbugs.gnu.org; Mon, 21 Aug 2023 09:01:00 -0400 Received: from s.wfbtzhsv.outbound-mail.sendgrid.net ([159.183.224.104]:51998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY4We-0003vF-Su for 64619@debbugs.gnu.org; Mon, 21 Aug 2023 09:00:58 -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: cc:content-type:from:subject:to; s=s1; bh=G5qIsniV2um4SZ7/2XOIipzxHeyF6AxfNSxQZ8c2bYI=; b=Z3Z6ZH1Z+mAYnp5C9ufQFukeonKuZQtMhhvFy/u0OWRcOSEzfZi9ohrJeXnBcwoX6+l7 Kdt03yr1C1IHB8Y/Qr1WvsiH+OaXDrq/2fpuEhHDjy0O6Q99Dj/9KID9MlUbY7xughzDNC J6Tqmkyca0Q+g8X4yHLaM4TBvv6ufYPU9OKffoa1nPJA/KbpUG4x+R7+Xw9a61OBwxpvth HZuAJvm4QXRk+EmLo3eA2ec8Rjx4wWDhR5vQmCJm1JMnWcBRIUKdS5ce1RxIu5No6b5e+Y AE0bCoamLZwWh1Ptl+SRtP4fZuGXfxt5frrh7b4zud7KoAUPiRgzNob3VFzMZRPA== Received: by filterdrecv-canary-6699d5694c-nnmg4 with SMTP id filterdrecv-canary-6699d5694c-nnmg4-1-64E36000-1B 2023-08-21 13:00:48.176952827 +0000 UTC m=+1183456.931318939 Received: from earth.catern.com (unknown) by geopod-ismtpd-9 (SG) with ESMTP id JR1wWO6YRnynd3rVWe4MwQ Mon, 21 Aug 2023 13:00:47.983 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gnu.org Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 8924A6016B; Mon, 21 Aug 2023 09:00:47 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <83il9axnll.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 20 Aug 2023 08:57:26 +0300") 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> Date: Mon, 21 Aug 2023 13:00:48 +0000 (UTC) Message-ID: <878ra4pn28.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbKsY9GtyUQB5ZvOBcg5tT?= =?us-ascii?Q?qSXEDVhCW09kgG6W6IoKrBVwyHUPQKDOI1ks=2FY2?= =?us-ascii?Q?SY0IE5nzfO=2FqGgWUqK=2FXu2MVoGifqLEDzFFHxjm?= =?us-ascii?Q?WwD=2FCcKAEA=2FkxcpjS4Upviw14jsb5NPiCaDSyjS?= =?us-ascii?Q?rKu0bAwlkI+ydAr4nhNXo7P0ee1dTpEwxQW6nYv?= =?us-ascii?Q?v6ma05Gvzu7kE=2Fu6k=3D?= To: Eli Zaretskii X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: sbaugh@janestreet.com, philipk@posteo.net, rudalics@gmx.at, drew.adams@oracle.com, 64619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Applied Eli's comments and added support for customizing which flag toggle-window-dedicated sets by default. New patch attached. Eli Zaretskii writes: >> From: sbaugh@catern.com >> Date: Sat, 19 Aug 2023 20:02:35 +0000 (UTC) >> Cc: Spencer Baugh , Eli Zaretskii , >> martin rudalics , Drew Adams , >> 64619@debbugs.gnu.org >> + >> +@kindex C-x w d >> +@findex toggle-window-dedicated >> + Toggle whether the current window is dedicated to the current > ^^^^^^^ > "selected", not "current". Or maybe "currently-selected". Selected seems more common than currently-selected so went with that. >> @@ -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? 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? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-toggle-window-dedicated-command-and-mode-line-wi.patch >From b92b7dcb9e8dcb017e69462f8f7e580dba2b8fce Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Sat, 19 Aug 2023 16:01:54 -0400 Subject: [PATCH] Add toggle-window-dedicated command and mode-line-window-dedicated It's sometimes useful to interactively make certain windows dedicated. This allows a level of interactive control over which window display-buffer uses. Additionally, when a window is dedicated (even without this new command) it can affect display-buffer behavior in ways which may be unexpected for users. Let's display the window dedicated status in the mode-line to help indicate what's going on. * doc/emacs/windows.texi (Displaying Buffers): Add information about dedicated windows and toggle-window-dedicated. * doc/emacs/screen.texi (Mode Line): Add information about the window dedicated indicator. * etc/NEWS: Announce mode-line-window-dedicated and toggle-window-dedicated. * lisp/window.el (toggle-window-dedicated): Add. (window-prefix-map): Add C-x w d binding. * lisp/bindings.el (mode-line-window-control): Add. (mode-line-window-dedicated): Add. (standard-mode-line-format): Insert mode-line-window-dedicated. --- doc/emacs/screen.texi | 8 +++++- doc/emacs/windows.texi | 22 +++++++++++++++++ etc/NEWS | 16 ++++++++++++ lisp/bindings.el | 34 ++++++++++++++++++++++++-- lisp/window.el | 55 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 132 insertions(+), 3 deletions(-) diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi index 5e9e89e6b11..d4e92c035b8 100644 --- a/doc/emacs/screen.texi +++ b/doc/emacs/screen.texi @@ -173,7 +173,7 @@ Mode Line The text displayed in the mode line has the following format: @example - @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. +It appears as @samp{D} for strong dedication and @samp{d} for other +forms of dedication. If the window is not dedicated, @var{d} does not +appear. @xref{Dedicated Windows,, elisp, The Emacs Lisp Reference +Manual}. + @var{fr} gives the selected frame name (@pxref{Frames}). It appears only on text terminals. The initial frame's name is @samp{F1}. diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index e4abdef76be..b1c36aec426 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi @@ -411,6 +411,28 @@ Displaying Buffers window on some other frame to display the desired buffer. Several of these commands are bound in the @kbd{C-x 5} prefix key. +@cindex dedicated window + Sometimes, a window is ``dedicated'' to its current buffer +@xref{Dedicated Windows,, elisp, The Emacs Lisp Reference Manual}. +@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. + +Usually, dedicated windows are used to display specialized buffers, +but dedication can sometimes be useful interactively. For example, +when viewing errors with @kbd{M-g M-n} @code{next-error}, newly +displayed source code may replace a buffer you want to refer to. If +you dedicate a window to that buffer, the command (through +@code{display-buffer}) will prefer to use a different window instead. + +@kindex C-x w d +@findex toggle-window-dedicated + Toggle whether the selected window is dedicated to the current +buffer. With a prefix argument, make the window strongly dedicated +instead. + @menu * Window Choice:: How @code{display-buffer} works. * Temporary Displays:: Displaying non-editable buffers. diff --git a/etc/NEWS b/etc/NEWS index 3cfc36e10da..cd4c414a64c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -92,6 +92,22 @@ plus, minus, check-mark, start, etc. The 'tool-bar-position' frame parameter can be set to 'bottom' on all window systems other than Nextstep. ++++ +** 'd' in the mode line now indicates that the window is dedicated. +Windows have always been able to be dedicated to a specific buffer; +see 'window-dedicated-p'. Now the mode line indicates the dedicated +status of a window, with 'd' appearing in the mode line if a window is +dedicated and 'D' if the window is strongly dedicated. This indicator +appears before the buffer name, and after the buffer modification and +remote buffer indicators (usually "---" together). + ++++ +** New command 'toggle-window-dedicated'. +This makes it easy to interactively mark a specific window as +dedicated, so it won't be reused by 'display-buffer'. This can be +useful for complicated window setups. It is bound to 'C-x w d' +globally. + ** cl-print *** You can expand the "..." truncation everywhere. The code that allowed "..." to be expanded in the *Backtrace* should diff --git a/lisp/bindings.el b/lisp/bindings.el index f1a75b080be..1e05c1de43c 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -298,6 +298,35 @@ mode-line-frame-identification ;;;###autoload (put 'mode-line-frame-identification 'risky-local-variable t) +(defvar mode-line-window-dedicated-keymap + (let ((map (make-sparse-keymap))) + (define-key map [mode-line mouse-1] #'toggle-window-dedicated) + (purecopy map)) "\ +Keymap for what is displayed by `mode-line-window-dedicated'.") + +(defun mode-line-window-control () + "Compute mode line construct for window dedicated state. +Value is used for `mode-line-window-dedicated', which see." + (cond + ((eq (window-dedicated-p) t) + `(:propertize + "D" + help-echo "Window strongly dedicated to its buffer\nmouse-1: Toggle" + local-map ,mode-line-window-dedicated-keymap + mouse-face 'mode-line-highlight)) + ((window-dedicated-p) + `(:propertize + "d" + help-echo "Window dedicated to its buffer\nmouse-1: Toggle" + local-map ,mode-line-window-dedicated-keymap + mouse-face 'mode-line-highlight)) + (t " "))) + +(defvar mode-line-window-dedicated '(:eval (mode-line-window-control)) + "Mode line construct to describe the current window.") +;;;###autoload +(put 'mode-line-window-dedicated 'risky-local-variable t) + (defvar-local mode-line-process nil "Mode line construct for displaying info on process status. Normally nil in most modes, since there is no process to display.") @@ -673,8 +702,9 @@ mode-line-end-spaces 'mode-line-mule-info 'mode-line-client 'mode-line-modified - 'mode-line-remote) - 'display '(min-width (5.0))) + 'mode-line-remote + 'mode-line-window-dedicated) + 'display '(min-width (6.0))) 'mode-line-frame-identification 'mode-line-buffer-identification " " diff --git a/lisp/window.el b/lisp/window.el index d91bbabc010..f1677060310 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7463,6 +7463,60 @@ display-buffer-mark-dedicated The actual non-nil value of this variable will be copied to the `window-dedicated-p' flag.") +(defcustom toggle-window-dedicated-flag 'interactive + "What dedicated flag should `toggle-window-dedicated' use by default. + +If `toggle-window-dedicated' does not receive a flag argument, +the value of this variable is used and passed to +`set-window-dedicated-p'. Setting this to t will make +`toggle-window-dedicated' use strong dedication by default. Any +other non-nil value will result in the same kind of non-strong +dedication." + :type '(choice (const :tag "Strongly dedicated" t) + (const :tag "Dedicated" interactive)) + :version "30.0" + :group 'windows) + +(defun toggle-window-dedicated (&optional window flag interactive) + "Toggle whether WINDOW is dedicated to its current buffer. + +WINDOW must be a live window and defaults to the selected one. +If FLAG is t (interactively, the prefix argument), make the window +\"strongly\" dedicated to its buffer. FLAG defaults to a non-nil, +non-t value, and is passed to `set-window-dedicated-p', which see. +If INTERACTIVE is non-nil, print a message describing the dedication +status of WINDOW, after toggling it. Interactively, this argument is +always non-nil. + +When a window is dedicated to its buffer, `display-buffer' will avoid +displaying another buffer in it, if possible. When a window is +strongly dedicated to its buffer, changing the buffer shown in the +window will usually signal an error. + +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. + +See the info node `(elisp)Dedicated Windows' for more details." + (interactive "i\nP\np") + (setq window (window-normalize-window window)) + (setq flag (cond + ((consp flag) t) + ((null flag) toggle-window-dedicated-flag) + (t flag))) + (if (window-dedicated-p window) + (set-window-dedicated-p window nil) + (set-window-dedicated-p window flag)) + (when interactive + (message "Window is %s dedicated to buffer %s" + (let ((status (window-dedicated-p window))) + (cond + ((null status) "no longer") + ((eq status t) "now strongly") + (t "now"))) + (current-buffer)) + (force-mode-line-update))) + (defconst display-buffer--action-function-custom-type '(choice :tag "Function" (const :tag "--" ignore) ; default for insertion @@ -10746,6 +10800,7 @@ window-prefix-map "2" #'split-root-window-below "3" #'split-root-window-right "s" #'window-toggle-side-windows + "d" #'toggle-window-dedicated "^ f" #'tear-off-window "^ t" #'tab-window-detach "-" #'fit-window-to-buffer -- 2.41.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 21 09:20:10 2023 Received: (at 64619) by debbugs.gnu.org; 21 Aug 2023 13:20:10 +0000 Received: from localhost ([127.0.0.1]:55857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY4pF-00071F-Vz for submit@debbugs.gnu.org; Mon, 21 Aug 2023 09:20:10 -0400 Received: from heytings.org ([95.142.160.155]:47946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY4pD-000716-Ik for 64619@debbugs.gnu.org; Mon, 21 Aug 2023 09:20:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1692624004; bh=u/9889SJ2qlkJG+kZgta5bnOSWFl01PXdhcNxkVhOEM=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=E183IQnABffqRYQkRR3lJnh2RfnUAifi1dwpazTc8Ap4Vjqu8fEasnIvca3XPKbDB DhCYxzKp33mj2WzZTpF2ebs6aidQg8bqfP3qrxXIWuYfC3XPqf31eF9C7wGtHYa3Xj +4MH5tWeb338tU3eHdKeSwrT9rifSHwV3WOFQyJzVY/lxYBVrbPJc2GLereNYkHa8O vKT2IDLHBrrfDad7MoMWZ1fFpJQTn8WFkjl+qEf4/Wvf8MDy2JiwzzpDf/938EsifT AwWjsya1JGG9R8jJdHoiNOtILrrsI1HlPMRDRDuwQOrlw0tjaMdHoOAfKaw6cy1Rpy afmHOyD6n61qQ== Date: Mon, 21 Aug 2023 13:20:03 +0000 From: Gregory Heytings To: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <878ra4pn28.fsf@catern.com> Message-ID: <77daee02cf5d74307061@heytings.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> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64619 Cc: sbaugh@janestreet.com, philipk@posteo.net, 64619@debbugs.gnu.org, rudalics@gmx.at, Eli Zaretskii , drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > Applied Eli's comments and added support for customizing which flag > toggle-window-dedicated sets by default. New patch attached. > Seeing that all my suggestions (about the key binding, about the weak/strong distinction, and about the switch-to-buffer-in-dedicated-window configuration variable) have been ignored, I bow out of this thread. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 21 10:02:10 2023 Received: (at 64619) by debbugs.gnu.org; 21 Aug 2023 14:02:10 +0000 Received: from localhost ([127.0.0.1]:57369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY5Tu-0008Ts-De for submit@debbugs.gnu.org; Mon, 21 Aug 2023 10:02:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47658) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY5Ts-0008Te-7j for 64619@debbugs.gnu.org; Mon, 21 Aug 2023 10:02:09 -0400 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 1qY5Tj-0004WN-8f; Mon, 21 Aug 2023 10:01:59 -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=cmjcCohsczk7W+eSiDUnHQl/v7d7R0dkrEwH3Irs8nk=; b=FmpmE650vB/C JSo3ihOTTklX/G3QRyaiT/JELyuEY18Fuc3kbcWTyw9bMlN34Wi1dtYPaWA2roNG4tlJ7ieYZl9Ik eFnkArS/Ua8Mo3jG7AqoTP4bqsCtzr+MDoY9ugy8t/x5yjlPJ7OjFEcLk9Nd4gkbIu2tZJrWywk54 CasJNmYkHpVVK+SkTybMwVtYQNp2t7zxS122NoFkcXXHPR5Nik24HBk6k0LSql9G4x7zhioqcRGFa Mi88gDuC9ZhRgtf0auCVjLjvhcD5M7e9wBFnOnaALFgHVm+5VQBpt0hdztXrentRiY1NdOx7cvlJu he1Ww36GBRQ5XUAjs/7wng==; Date: Mon, 21 Aug 2023 17:02:15 +0300 Message-Id: <834jksv6hk.fsf@gnu.org> From: Eli Zaretskii To: Gregory Heytings In-Reply-To: <77daee02cf5d74307061@heytings.org> (message from Gregory Heytings on Mon, 21 Aug 2023 13:20:03 +0000) Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command 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> <77daee02cf5d74307061@heytings.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 21 Aug 2023 13:20:03 +0000 > From: Gregory Heytings > cc: Eli Zaretskii , sbaugh@janestreet.com, philipk@posteo.net, > rudalics@gmx.at, drew.adams@oracle.com, 64619@debbugs.gnu.org > > Seeing that all my suggestions (about the key binding, about the > weak/strong distinction, and about the > switch-to-buffer-in-dedicated-window configuration variable) have been > ignored, I bow out of this thread. They are not ignored. We haven't yet installed anything. We are still discussing. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 21 15:20:52 2023 Received: (at 64619) by debbugs.gnu.org; 21 Aug 2023 19:20:53 +0000 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 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 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==; Date: Mon, 21 Aug 2023 22:20:20 +0300 Message-Id: <83r0nwtd6z.fsf@gnu.org> From: Eli Zaretskii To: sbaugh@catern.com In-Reply-To: <878ra4pn28.fsf@catern.com> (sbaugh@catern.com) Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: sbaugh@janestreet.com, philipk@posteo.net, rudalics@gmx.at, drew.adams@oracle.com, 64619@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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." From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 21 15:22:11 2023 Received: (at 64619) by debbugs.gnu.org; 21 Aug 2023 19:22:11 +0000 Received: from localhost ([127.0.0.1]:57858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYATb-0003Yy-3V for submit@debbugs.gnu.org; Mon, 21 Aug 2023 15:22:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYATY-0003Yl-DL for 64619@debbugs.gnu.org; Mon, 21 Aug 2023 15:22:09 -0400 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 1qYATO-0002LA-AC; Mon, 21 Aug 2023 15:21:58 -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=LiLAPMtANe87kkpecUSI2xIK5uXNF9/tFxSXhcrijBQ=; b=XJLbeFwOywZe 6jR2ZPTuEw41yXng9qfXptevsCu/EPdm1yQWtJUlmSjfMkzb9FU5kEWGViNRynqh52NZRZS91LZ3i Ut3Lo4X1qBEZ+I6cPWMO16a8/FAwQahAAH0Oy3Mq32ve+rs7o+JHtsiLxAmJBHIi4ROfdyJqY7MwW 86b0lcOOoVcYxzk91ALoXuzFrr7sOhORN/nRL5E2aJa02B+srQqxhgnMp8kCIsOWmx7Mni2+BAyOz 1h5WnAGJKsToTleVKA+313MMImcwtWqsCuOghlgZOgPgIuZpYYNGZ9mvijrJ6QUA7zXisK/Y1bq2z BPBmYTe98kKGJmxykQcKFQ==; Date: Mon, 21 Aug 2023 22:22:16 +0300 Message-Id: <83pm3gtd3r.fsf@gnu.org> From: Eli Zaretskii To: gregory@heytings.org In-Reply-To: <834jksv6hk.fsf@gnu.org> (message from Eli Zaretskii on Mon, 21 Aug 2023 17:02:15 +0300) Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command 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> <77daee02cf5d74307061@heytings.org> <834jksv6hk.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619 Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 64619@debbugs.gnu.org, philipk@posteo.net, sbaugh@janestreet.com, > sbaugh@catern.com, rudalics@gmx.at, drew.adams@oracle.com > Date: Mon, 21 Aug 2023 17:02:15 +0300 > From: Eli Zaretskii > > > Date: Mon, 21 Aug 2023 13:20:03 +0000 > > From: Gregory Heytings > > cc: Eli Zaretskii , sbaugh@janestreet.com, philipk@posteo.net, > > rudalics@gmx.at, drew.adams@oracle.com, 64619@debbugs.gnu.org > > > > Seeing that all my suggestions (about the key binding, about the > > weak/strong distinction, and about the > > switch-to-buffer-in-dedicated-window configuration variable) have been > > ignored, I bow out of this thread. > > They are not ignored. We haven't yet installed anything. We are > still discussing. Can you tell why you dislike Spencer's last patch? It allows an easy customization to have the default that you wanted. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 04 04:20:29 2023 Received: (at control) by debbugs.gnu.org; 4 Sep 2023 08:20:29 +0000 Received: from localhost ([127.0.0.1]:48258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qd4ou-00050F-VA for submit@debbugs.gnu.org; Mon, 04 Sep 2023 04:20:29 -0400 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:47306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qd4os-0004zw-IV for control@debbugs.gnu.org; Mon, 04 Sep 2023 04:20:27 -0400 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2bbbda48904so18466171fa.2 for ; Mon, 04 Sep 2023 01:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693815621; x=1694420421; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=hZv2TfHjeOt5ur/9zPtIJINPVvlhzeQJMo/iWn5KIqY=; b=mhHUcJUw+xILa+MR73blnBx9gf78LdFPwoiArbhIQ3lgbK1ryBCwPB39c3BEPL/YHi MoG+UXaO0vxMi9Lxc98I0tpOJ3pu2AHszMIoDQrLXJ6yPd7EJxYMGQs4XoiURCVxt3VD Vqa0Xnp5DfRxQ6rUQ0sVVBebMT88nUYfYUE8rgPWGXtqhYTqQ+Rae2BiAchwW0vrHkcM d2uuLoDDMJLF1KvGPNHhGShgqCnCPDz1hpwa6ua9XmfR6Iy4iwMzXdXwzCkayAT9k8fB 5fTNq+z67jmoumnM7wfRDCJWpkuYSy1Lor+XOeRPWyU5w8/gHGM8rPbtv7VIC+rWszSv vOCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693815621; x=1694420421; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=hZv2TfHjeOt5ur/9zPtIJINPVvlhzeQJMo/iWn5KIqY=; b=ICYURcpY820XNr+OqB1R4TM/o+jHsY0tfxyN5Mcbbxsq7O8BIaFqaLt3k3EieSHeu1 lNjT/XdlqrLzMITOytOog9iOzfmjkxP5Qi0BKGMS5sKGmShFGhxMBlq9qqP0fSBEXorT QdukE01Q3TKnTU25hdPeuo8bljdBm/qtt/j5skStUQKhfji+mdj/rGxT+avtLO3R5nWU LHULFGdf2jWgvK8PpQ9H6k3Y0CavzYJBmBixesNek+F6UUaEDk9QzDNtnYUoCS3Fdwof 6DAKTDx23yKAJqmSsL0Ha8gFf1BzFQwYetMkbBqDNVT8AWethhhdlCD7FawBCwfuSHL/ M29Q== X-Gm-Message-State: AOJu0YzOZcI8bCDHVzrUPevfEHoFfXpFW+Nv2jaNh2Q/CbLpZ4V9q0Lq YOvlvSug7AMX6gVQCHV56J9C6lJ2c/XHhn69lVSQzE9NLa0= X-Google-Smtp-Source: AGHT+IGvDSzO8z+xA6Hdf6C3H+CuDYitRDtrTs8H7tD0puLKuyf4pTtBhhTEh0mjZSG+JOY9Xqx1ZciEfHUmsv5olEE= X-Received: by 2002:a05:6512:39ca:b0:4f8:714e:27a8 with SMTP id k10-20020a05651239ca00b004f8714e27a8mr6732735lfu.0.1693815620674; Mon, 04 Sep 2023 01:20:20 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 4 Sep 2023 01:20:20 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Mon, 4 Sep 2023 01:20:20 -0700 Message-ID: Subject: control message for bug #64619 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 64619 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 12 21:33:46 2023 Received: (at 64619) by debbugs.gnu.org; 13 Oct 2023 01:33:46 +0000 Received: from localhost ([127.0.0.1]:44503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qr73h-0004wL-4n for submit@debbugs.gnu.org; Thu, 12 Oct 2023 21:33:46 -0400 Received: from s.wfbtzhsw.outbound-mail.sendgrid.net ([159.183.224.105]:34982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qr73c-0004w2-Iv for 64619@debbugs.gnu.org; Thu, 12 Oct 2023 21:33:43 -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: cc:content-type:from:subject:to; s=s1; bh=KjOSU2lKJ3gSeuKfUbycog/o5RzSIy8v6iYxzJ7tNoc=; b=IO/DYY9Oy7hQ6OjMzWdAQNMLq3eRbxcQjpcLy6cGx1rLpA8swRM2L9fGslgpahkaovzd uJAqr4BNwBHBe0WwkVo2r/pu/esge+OlXG3xw5xGYx9xiHS/xPUzIu4K/Y0Ob7ei9QBdIz YeKag1GJ8ORFaTyuANyt2wms/oIcasdfhcMSZ0eEut+GPs/ytPD6ae3aDV3ZAof/EwBG52 3wuAhIibK7JaMzMjqZhPWbezV9i2KKR5ay0S9OtZbwNxJNfxGNm46a1A8zgPVKvQ8fnl+E QEUeIauPobTbAyHSq7R0ZZuqnRKmrpL28ftPaEX5gWuxx51QVZOweT1Bz63XUyow== Received: by filterdrecv-6488dc484d-ddjr6 with SMTP id filterdrecv-6488dc484d-ddjr6-1-65289E57-14 2023-10-13 01:33:11.397231885 +0000 UTC m=+191429.230150949 Received: from earth.catern.com (unknown) by geopod-ismtpd-1 (SG) with ESMTP id VmYD42NfTomCpfpzC0StpQ Fri, 13 Oct 2023 01:33:11.278 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gnu.org Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id C4AA6633C9; Thu, 12 Oct 2023 21:33:10 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command In-Reply-To: <83r0nwtd6z.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 21 Aug 2023 22:20:20 +0300") 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> <83r0nwtd6z.fsf@gnu.org> Date: Fri, 13 Oct 2023 01:33:11 +0000 (UTC) Message-ID: <875y3bz4q1.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbIgG4W0kgbMRV7xgq4PR=2F?= =?us-ascii?Q?QSYMaGJzkKgX6dq+Kuhx30USNefr00FJGih2Q5f?= =?us-ascii?Q?XqNSCwDNDicqdjEaoOOrdg1b26UBV3KnUXQofpp?= =?us-ascii?Q?k+GF3N9b+JV2O1utG8bjq0CEWcHuU5zsPwMXVAN?= =?us-ascii?Q?ILfosCbOpxObjoK1BSss3iXWnYUMjn8rAxQ=3D=3D?= To: Eli Zaretskii X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 64619 Cc: sbaugh@janestreet.com, philipk@posteo.net, 64619@debbugs.gnu.org, drew.adams@oracle.com, rudalics@gmx.at X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) --=-=-= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Eli Zaretskii writes: >> 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." All fixed, here's my revised patch. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-toggle-window-dedicated-command-and-mode-line-wi.patch >From d17c90d084a29430b2c131e34ff76d4e9762b8dc Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Sat, 19 Aug 2023 16:01:54 -0400 Subject: [PATCH] Add toggle-window-dedicated command and mode-line-window-dedicated It's sometimes useful to interactively make certain windows dedicated. This allows a level of interactive control over which window display-buffer uses. Additionally, when a window is dedicated (even without this new command) it can affect display-buffer behavior in ways which may be unexpected for users. Let's display the window dedicated status in the mode-line to help indicate what's going on. * doc/emacs/windows.texi (Displaying Buffers): Add information about dedicated windows and toggle-window-dedicated. * doc/emacs/screen.texi (Mode Line): Add information about the window dedicated indicator. * etc/NEWS: Announce mode-line-window-dedicated and toggle-window-dedicated. * lisp/window.el (toggle-window-dedicated): Add. (bug#64619) (window-prefix-map): Add C-x w d binding. * lisp/bindings.el (mode-line-window-control): Add. (mode-line-window-dedicated): Add. (standard-mode-line-format): Insert mode-line-window-dedicated. --- doc/emacs/screen.texi | 8 +++++- doc/emacs/windows.texi | 22 ++++++++++++++++ etc/NEWS | 21 +++++++++++++++ lisp/bindings.el | 34 ++++++++++++++++++++++-- lisp/window.el | 59 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 141 insertions(+), 3 deletions(-) diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi index 5e9e89e6b11..3b910587260 100644 --- a/doc/emacs/screen.texi +++ b/doc/emacs/screen.texi @@ -173,7 +173,7 @@ Mode Line The text displayed in the mode line has the following format: @example - @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. +It appears as @samp{D} for strong dedication and @samp{d} for other +forms of dedication. If the window is not dedicated, @var{d} does not +appear. @xref{Dedicated Windows,, elisp, The Emacs Lisp Reference +Manual}. + @var{fr} gives the selected frame name (@pxref{Frames}). It appears only on text terminals. The initial frame's name is @samp{F1}. diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 665fd80e53b..ca5e424d939 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi @@ -411,6 +411,28 @@ Displaying Buffers window on some other frame to display the desired buffer. Several of these commands are bound in the @kbd{C-x 5} prefix key. +@cindex dedicated window + Sometimes, a window is ``dedicated'' to its current buffer. +@xref{Dedicated Windows,, elisp, The Emacs Lisp Reference Manual}. +@code{display-buffer} will avoid reusing dedicated windows most of the +time. This is indicated by a @samp{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 +@samp{D} in the mode line. + +Usually, dedicated windows are used to display specialized buffers, +but dedication can sometimes be useful interactively. For example, +when viewing errors with @kbd{M-g M-n} @code{next-error}, newly +displayed source code may replace a buffer you want to refer to. If +you dedicate a window to that buffer, the command (through +@code{display-buffer}) will prefer to use a different window instead. + +@kindex C-x w d +@findex toggle-window-dedicated + Toggle whether the selected window is dedicated to the current +buffer. With a prefix argument, make the window strongly dedicated +instead. + @menu * Window Choice:: How @code{display-buffer} works. * Temporary Displays:: Displaying non-editable buffers. diff --git a/etc/NEWS b/etc/NEWS index cfcb8104cca..647562143de 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -135,6 +135,27 @@ window systems other than Nextstep. When this minor mode is enabled, buttons representing modifier keys are displayed along the tool bar. ++++ +** 'd' in the mode line now indicates that the window is dedicated. +Windows have always been able to be dedicated to a specific buffer; +see 'window-dedicated-p'. Now the mode line indicates the dedicated +status of a window, with 'd' appearing in the mode line if a window is +dedicated and 'D' if the window is strongly dedicated. This indicator +appears before the buffer name, and after the buffer modification and +remote buffer indicators (usually "---" together). + ++++ +** New command 'toggle-window-dedicated'. +This makes it easy to interactively mark a specific window as +dedicated, so it won't be reused by 'display-buffer'. This can be +useful for complicated window setups. It is bound to 'C-x w d' +globally. + +** cl-print +*** You can expand the "..." truncation everywhere. +The code that allowed "..." to be expanded in the *Backtrace* should +now work anywhere the data is generated by `cl-print`. + --- ** New user option 'uniquify-dirname-transform'. This can be used to customize how buffer names are uniquified, by diff --git a/lisp/bindings.el b/lisp/bindings.el index 70e4087e131..418ee265e69 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -298,6 +298,35 @@ mode-line-frame-identification ;;;###autoload (put 'mode-line-frame-identification 'risky-local-variable t) +(defvar mode-line-window-dedicated-keymap + (let ((map (make-sparse-keymap))) + (define-key map [mode-line mouse-1] #'toggle-window-dedicated) + (purecopy map)) "\ +Keymap for what is displayed by `mode-line-window-dedicated'.") + +(defun mode-line-window-control () + "Compute mode line construct for window dedicated state. +Value is used for `mode-line-window-dedicated', which see." + (cond + ((eq (window-dedicated-p) t) + (propertize + "D" + 'help-echo "Window strongly dedicated to its buffer\nmouse-1: Toggle" + 'local-map mode-line-window-dedicated-keymap + 'mouse-face 'mode-line-highlight)) + ((window-dedicated-p) + (propertize + "d" + 'help-echo "Window dedicated to its buffer\nmouse-1: Toggle" + 'local-map mode-line-window-dedicated-keymap + 'mouse-face 'mode-line-highlight)) + (t ""))) + +(defvar mode-line-window-dedicated '(:eval (mode-line-window-control)) + "Mode line construct to describe the current window.") +;;;###autoload +(put 'mode-line-window-dedicated 'risky-local-variable t) + (defvar-local mode-line-process nil "Mode line construct for displaying info on process status. Normally nil in most modes, since there is no process to display.") @@ -676,8 +705,9 @@ mode-line-end-spaces 'mode-line-mule-info 'mode-line-client 'mode-line-modified - 'mode-line-remote) - 'display '(min-width (5.0))) + 'mode-line-remote + 'mode-line-window-dedicated) + 'display '(min-width (6.0))) 'mode-line-frame-identification 'mode-line-buffer-identification " " diff --git a/lisp/window.el b/lisp/window.el index 2f9b46ebb0a..7c2ead7e5fe 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7468,6 +7468,64 @@ display-buffer-mark-dedicated The actual non-nil value of this variable will be copied to the `window-dedicated-p' flag.") +(defcustom toggle-window-dedicated-flag 'interactive + "What dedicated flag should `toggle-window-dedicated' use by default. + +If `toggle-window-dedicated' does not receive a flag argument, +the value of this variable is used and passed to +`set-window-dedicated-p'. Setting this to t will make +`toggle-window-dedicated' use strong dedication by default. Any +other non-nil value will result in the same kind of non-strong +dedication." + :type '(choice (const :tag "Strongly dedicated" t) + (const :tag "Dedicated" interactive)) + :version "30.0" + :group 'windows) + +(defun toggle-window-dedicated (&optional window flag interactive) + "Toggle whether WINDOW is dedicated to its current buffer. + +WINDOW must be a live window and defaults to the selected one. +If FLAG is t (interactively, the prefix argument), make the window +\"strongly\" dedicated to its buffer. FLAG defaults to a non-nil, +non-t value, and is passed to `set-window-dedicated-p', which see. +If INTERACTIVE is non-nil, print a message describing the dedication +status of WINDOW, after toggling it. Interactively, this argument is +always non-nil. + +When a window is dedicated to its buffer, `display-buffer' will avoid +displaying another buffer in it, if possible. When a window is +strongly dedicated to its buffer, changing the buffer shown in the +window will usually signal an error. + +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 and +\\[universal-argument] will make the window weakly dedicated. + +See the info node `(elisp)Dedicated Windows' for more details." + (interactive "i\nP\np") + (setq window (window-normalize-window window)) + (setq flag (cond + ((consp flag) + (if (eq toggle-window-dedicated-flag t) + 'interactive + t)) + ((null flag) toggle-window-dedicated-flag) + (t flag))) + (if (window-dedicated-p window) + (set-window-dedicated-p window nil) + (set-window-dedicated-p window flag)) + (when interactive + (message "Window is %s dedicated to buffer %s" + (let ((status (window-dedicated-p window))) + (cond + ((null status) "no longer") + ((eq status t) "now strongly") + (t "now"))) + (current-buffer)) + (force-mode-line-update))) + (defconst display-buffer--action-function-custom-type '(choice :tag "Function" (const :tag "--" ignore) ; default for insertion @@ -10750,6 +10808,7 @@ window-prefix-map "2" #'split-root-window-below "3" #'split-root-window-right "s" #'window-toggle-side-windows + "d" #'toggle-window-dedicated "^ f" #'tear-off-window "^ t" #'tab-window-detach "-" #'fit-window-to-buffer -- 2.41.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 25 09:46:42 2023 Received: (at 64619-done) by debbugs.gnu.org; 25 Oct 2023 13:46:43 +0000 Received: from localhost ([127.0.0.1]:57759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qveDa-0002gh-IQ for submit@debbugs.gnu.org; Wed, 25 Oct 2023 09:46:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qveDV-0002gN-Lz for 64619-done@debbugs.gnu.org; Wed, 25 Oct 2023 09:46:41 -0400 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 1qveCu-00028x-J2; Wed, 25 Oct 2023 09:46:00 -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=g4BX57mxS6whfpbI40KfLtfpj87wDsXtfOwG4jOF2fk=; b=NJCTB0nSE2r6 cc02g/CkXQtuiUoX3u131sd1dbage9baeHkLeFe52d5UvIgy7JzcKOdfSgUVwlIPYUtDU7AaQMWd5 Ut8vYvY1tqn8LP8ABOOIZrTRTLMiKzJUyNkA4pZT3P0XidnySneFri/uz9+nnEgRTbEn4iXAWnapr kk94Ho/09U+jWJEcj80mixDrGQEmC+1JbxY7sYMeHjqmm3sGFrLtJ+YFA9YovaDf89AnnUOV74mXg N83WPI0XCuVOai7khnz5RVO+lW7Vzsd08idv6G7lFxWmIcun43mTtM8RvUe1bbp4thDeOQ6jC+SbG fQojlcNBSIhU8VyRBMLAag==; Date: Wed, 25 Oct 2023 16:46:07 +0300 Message-Id: <83zg06izmo.fsf@gnu.org> From: Eli Zaretskii To: sbaugh@catern.com In-Reply-To: <875y3bz4q1.fsf@catern.com> (sbaugh@catern.com) Subject: Re: bug#64619: [PATCH] Add toggle-window-dedicated command 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> <83r0nwtd6z.fsf@gnu.org> <875y3bz4q1.fsf@catern.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64619-done Cc: sbaugh@janestreet.com, philipk@posteo.net, 64619-done@debbugs.gnu.org, drew.adams@oracle.com, rudalics@gmx.at X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: sbaugh@catern.com > Date: Fri, 13 Oct 2023 01:33:11 +0000 (UTC) > Cc: sbaugh@janestreet.com, philipk@posteo.net, rudalics@gmx.at, > drew.adams@oracle.com, 64619@debbugs.gnu.org > > All fixed, here's my revised patch. Thanks, installed on the master branch, and closing the bug. From unknown Sat Aug 09 13:18:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 23 Nov 2023 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator