From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#64619: [PATCH] Add toggle-window-dedicated command Date: Fri, 14 Jul 2023 21:17:18 +0000 Message-ID: References: <87jzv2p9e0.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34856"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "64619@debbugs.gnu.org" <64619@debbugs.gnu.org> To: Philip Kaludercic , Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 14 23:18:23 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qKQBC-0008pI-P1 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Jul 2023 23:18:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qKQAu-0000LA-UN; Fri, 14 Jul 2023 17:18:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKQAt-0000Kc-35 for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 17:18:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qKQAs-0001uC-R2 for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 17:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qKQAs-0005mb-FG for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 17:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Jul 2023 21:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64619 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64619-submit@debbugs.gnu.org id=B64619.168936944722188 (code B ref 64619); Fri, 14 Jul 2023 21:18:02 +0000 Original-Received: (at 64619) by debbugs.gnu.org; 14 Jul 2023 21:17:27 +0000 Original-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 Original-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 Original-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== Original-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 Original-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 Original-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= Original-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 Original-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 Thread-Topic: [External] : bug#64619: [PATCH] Add toggle-window-dedicated command Thread-Index: AQHZtouAAI6AYB2XNEOqIEZPsKmQda+5ubMg In-Reply-To: <87jzv2p9e0.fsf@posteo.net> Accept-Language: en-US Content-Language: en-US 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: 5RvugSJhtyDiEEof8kj1RX74IEFqj5D2FOA3Gk3LE1wP6gDNudlJa3RbLBB3FzgKXcCpnybYvr3Mg484PTtvu1dra+c252Am6jO/TwJ6AvuhGetQriPvVdbZ2ry9fhdObFSGd72zGqvrDY6Si/lernB+kCz6yCvIoHA+KiU4d1fzPEcAEQLLoC2C5TMEH9HlE+DOXjUdFzTcNnrjaa0wa+X6dhclxu6VUghFfAi+5uyQ7dABHoujowhjA4lygW4DGgiO1F04KZLh/tjI7EK8NfV8t9mjbYZfEy/699Bc4DDzC2nvWxP0k8Rrgpo2+/9XIw9MQHAWO8xnENc9FFgJMdSUHHPEFn2PD9zkf85c1/w0pIWCnMTZ1xRmnXOd3UadJfireFLXqoem7uFBZRIaBiORTV7UM9D8+pp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3w4j/+qFUsMCVFpf0hcP0afCWo1l5egJdtKVeGn75N2SZo1aAectLH41oh+lmcRgeycbL1sTDzDllWp+RCmjDNUZPnBE4pQDtRct783N9NftgsJst2kJeMc+hUxIVxU26DaeRoTroYk4ERDrEXdTO4YV6tLn8s1AujW5bbXjFQBmURDTKXyJgtM k2BrFrtK0N1cnZuwXcQcIwUpIZYJuBidkVOHu0LjNkuOPcD3uW5jAiymtbz1TvcbncmTNhIlDs11WGmJcJvc1i2v7vV8kgv50p 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:265128 Archived-At: 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