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.devel Subject: RE: [External] : Re: Change default behavior of some commands that act on region? Date: Sun, 23 May 2021 00:25:34 +0000 Message-ID: References: <83sg2ekg93.fsf@gnu.org> 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="879"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: Eli Zaretskii , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 23 02:28:56 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lkbzE-000AYZ-5W for ged-emacs-devel@m.gmane-mx.org; Sun, 23 May 2021 02:28:56 +0200 Original-Received: from localhost ([::1]:60080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkbzD-0000on-62 for ged-emacs-devel@m.gmane-mx.org; Sat, 22 May 2021 20:28:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkbw5-0004ay-Op for emacs-devel@gnu.org; Sat, 22 May 2021 20:25:42 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:50760) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkbw2-0000bG-NJ; Sat, 22 May 2021 20:25:41 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14N0PaNW015967; Sun, 23 May 2021 00:25:36 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-2020-01-29; bh=dv8PPhhmeaBJBquS+WReDb/ZNgIh4NKUw67zTAgHID0=; b=JqFF9YFlmzlaQ35YLAnnn7EqlI7eiz5HqEoexhnNv/PDw1GWioN3XMBRlaUSrJZQDey/ 89hHjeBR+9djeRns9lzGw63nqWSJ4nBoHi33225xSJQossOw4kJPntX/Sxzzs0V/6NxQ vsxyP0PcrfxbBjT2OkdYACiYEIfbIuQ9MtA8XYCCAO3+xwFYDuiDNuXHIB1Oj19TY73N sEv4rOxEjco5y19nxn76S1clHIgoASAPxgMut/IiN7aXpFYhatj8lVjDFiNtcOzyVmF+ fjFoNEIMidbS24q2FNeRDL41BTKkvpPggzndWkjAK0pUy3xL6ZreuoRyRdDrmKEnq+Ui Pg== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 38q3q8r8tj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 May 2021 00:25:36 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14N0A7i3118236; Sun, 23 May 2021 00:25:36 GMT Original-Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2048.outbound.protection.outlook.com [104.47.51.48]) by userp3020.oracle.com with ESMTP id 38qbqq0hyd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 May 2021 00:25:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i6DQUKNL2kLg9UNphon8cw8oF4pLWJno4wJyMQGxO0jRNsrRZXZoDY1O0iAKNQx1cyezuInEiPiPIUPwbvwBlYD6QeuAOUcnhV61FAmux3sp5IzeeAOWN/PWVFWnb/vZ3+yoTBUcHuuVHkCQelWcshEj2T85tJ70uoHd5yguOJa7SDVy5BMBQlH3OJf6wRksNMQnfyNuPXS1gr+6YAjnr1vkMMiN6CrxYM6M8nNFIdNBQ8jHIRWF47JCnuoraL4Fq2h3oYm4YXON44nj2bIhZn/h6TsiIGq6AumYylnDMAthXNKYlWIP65jFntZs/JZnd7bDZnnjPmYMNTwBCQh/Tw== 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-SenderADCheck; bh=dv8PPhhmeaBJBquS+WReDb/ZNgIh4NKUw67zTAgHID0=; b=cBMPkr4z4ZurSO+vBztnnKhwMXdEqPMYvaZ/THMxgPJfiYULR9Gh28nyspFW3ur766DQfmlzYKYf82lbyOPF96EFPX0kuBXj42kM/P00kxITJsbTSSqnDVdvsy1e0FxihxppIQw8TECDhuj1peJ61tgGOjO0lL5+7w2F+HWkC6aPkFArfcIMmQvTKTSMGY24YpygXxZ7cJLKm1VBqSWqVRHTlIx4Vfn5rJj3vADs0bRffijyTYJGmfV8vW2kFclWPHUzY5TGkahcBsDOMY3yQ/sAtNO7ZIYQOZrI1JJBW/x8LOyoSHeHpQ0WkX1S6z1fhxp3N8XNZCQA8o80Zs33mw== 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=dv8PPhhmeaBJBquS+WReDb/ZNgIh4NKUw67zTAgHID0=; b=GHfRsVAjFE3yjQf0D8upUmWvNs+0y6iBdq6D10GM5hRlcXrJg8xWNgMm8qieitP3CkvuPUu06eZ9kWFEvg94zOm0StEc5LT5WBzVg7RoKzFubw/Uf0ThO3KTlDjGbP0BVozKlcmZ5BkHQBkihLtRyq9wgQvC4htHx9FgZ/lXNBs= Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com (2603:10b6:806:11b::15) by SN6PR10MB2893.namprd10.prod.outlook.com (2603:10b6:805:d1::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.25; Sun, 23 May 2021 00:25:34 +0000 Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::2109:9725:fd4a:6494]) by SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::2109:9725:fd4a:6494%6]) with mapi id 15.20.4150.026; Sun, 23 May 2021 00:25:34 +0000 Thread-Topic: [External] : Re: Change default behavior of some commands that act on region? Thread-Index: AddOgj9jmbCPuskvSDmMk5TwAnSeOQAkobN4ABOgQ8A= In-Reply-To: <83sg2ekg93.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US authentication-results: gnu.org; dkim=none (message not signed) header.d=none;gnu.org; dmarc=none action=none header.from=oracle.com; x-originating-ip: [73.170.83.28] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d282ee83-9283-4622-6d68-08d91d8147ee x-ms-traffictypediagnostic: SN6PR10MB2893: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: s4pwJdvq2pREFSEcxXXp9pfvKsyecdU+2M8lsJV690VqpwpaU8EDTOoHIU2kGnHC6gUZntHk1Ccv7eZ+hX8eXD0fY7UXHwr+dsw7YAXEdnElIt1WxgoKOV+o0nYZxDY9w3f58aNJ6i7hpXmUN9n5SHI6HgbR/TbJU4HW0WvySwiUipWeMyI3Q5ZgQYMz3uxWuutj4bEb/l1yLGysL4+bEyaG4GQFV+WRvjpCqw+6HfRg+KbZP1We5w7IISTQqLldg9Bm2ojTTUe3LG/eYDlTMgCNrEARdbCJjX7ksA0aWhUzxRs2zagE73fRoqJ0RbA7w7qvLzt+2U1FR+s66J1VJyq4K1+Acm6fDQTMX/o0IPP5yiw4DduhuYgwFfa7uoMCRd8wnafo/eaiVI+8BXZcFxos4rvrSzhX64g2pqwa3z3u+NupTiNp2gg/FjXszNekh2kVaol0965CIg6lmMtGzAhVBUMNLQvhb5JdV7Qy5aKmeHwdNs1Ww6Hxa1OwVnCoeRkUASOC7FQlj5/02iW8br/ND/6r7+SDWBz0HjLqpXWRAXk6CwCiPFziLoBVHfigYJsK8aKjDafDXUbWQCIicK1oDyzfisTovpTHcuh17k4= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR10MB4474.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(376002)(366004)(346002)(396003)(39860400002)(110136005)(52536014)(4326008)(26005)(33656002)(5660300002)(83380400001)(122000001)(8936002)(44832011)(71200400001)(316002)(2906002)(186003)(6506007)(9686003)(38100700002)(55016002)(478600001)(8676002)(64756008)(86362001)(66476007)(66446008)(66556008)(76116006)(7696005)(66946007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?em0RaTalYdMJQQWDyEfMaWAgGYFfHCxn1RkphUhCSueR/6Z4aORE8oem7O5R?= =?us-ascii?Q?8V8D6I5k2H+KQu6kevj5Uw6FX4YQgbol4L3qRhqjQAhr0TM3Oam1cHh7mQs6?= =?us-ascii?Q?kfkTEkNjZGUwM1nB9nrSlUsrE3wIhz5BlxIu0u6GSmxOhkirvzE2yRWLbVII?= =?us-ascii?Q?Rz8L4K5b7fzShWVZKzjNvu/C0xnDyiwfdSXhuW1Ngy5HlBoiSxd5kXts0Ijy?= =?us-ascii?Q?BGSNICqYHi+W9iHWOCJ6j9qCHP0GYsgDGI2oOmwkytnTy7IxiMJeVgYXA8np?= =?us-ascii?Q?4Ub3Glg34h98eruq+WfEXjBnNz1WFF0LkIDoVUWINZ7Op3aN3o073IvTiW2q?= =?us-ascii?Q?7rVBU+vZxjYWCeMAuiVy36AtU7o5QthK0DX8P5z4H/Fi9WKVhZFKKBkbmvjs?= =?us-ascii?Q?Nxlp8Xq287F8MH8nzGsR/t2pX62fJj+EfE4MHtYm9I32bkC+gu7S999fQumX?= =?us-ascii?Q?0Ysb3umRrpsC1unfyM6lSBofSVxHC6VmkzBaUwZtDCiks8ArvAlt3ONE9kOy?= =?us-ascii?Q?uX2bz9+Q7GGdJeqRRdcwJ/6t7fuYaidv9zRdfJDzBsf9LcoRkTdeQ0ajoBsk?= =?us-ascii?Q?7xEDWhXikvLG/B6M7mDdzmZSHKEW9exTi7YlruHelbkLkk8Ndo3drt5Ba9N2?= =?us-ascii?Q?lmQ7 x-ms-exchange-transport-forked: True X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4474.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d282ee83-9283-4622-6d68-08d91d8147ee X-MS-Exchange-CrossTenant-originalarrivaltime: 23 May 2021 00:25:34.3414 (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: kRal0hrr22hhATFaAOPJWadpcIdySZ6PQxZELV8fGebMWzRpH27vTlkMiyw/Vd6DtAmKTk8jbRNAPAt92MKNBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB2893 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9992 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105220181 X-Proofpoint-GUID: dTht97fCtk4g5MHwcgfSar01qx8i9LSd X-Proofpoint-ORIG-GUID: dTht97fCtk4g5MHwcgfSar01qx8i9LSd X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9992 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxscore=0 clxscore=1015 malwarescore=0 bulkscore=0 impostorscore=0 phishscore=0 spamscore=0 adultscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105230000 Received-SPF: pass client-ip=156.151.31.86; envelope-from=drew.adams@oracle.com; helo=userp2130.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_L3=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269641 Archived-At: > > Breaking long-standing behavior. I'll let others figure > > out how to minimize this (e.g. by testing for > > `transient-mark-mode` or something). There's nothing to figure out. The proposal said clearly from the outset that it would have NO effect when `transient-mark-mode' is turned OFF. So yes, `transient-mark-mode' would be tested, and if nil then the long-standing behavior would be UNCHANGED. Similarly, the behavior of Lisp code that invokes the command non-interactively would be UNCHANGED. (if (or (not (called-interactively-p 'interactive)) (not transient-mark-mode)) (apply COMMAND ARGS) ; NO CHANGE FROM PAST BEHAVIOR ;; Do what user wants for such a command ;; when region is inactive. ... ) The only change in "long-standing behavior" would be for interactive use when `transient-mark-mode' is turned ON. And even that could be configurable. E.g.: * A list (defvar) of the commands that would be affected. Users could change this, but mostly would not bother. * A defcustom to choose command behavior for inactive region: 1. Do nothing (ignore - command is a no-op on inactive region). 2. Prompt to confirm action. (e.g. "Region is inactive. Invoke `foobar' on it anyway?") 3. Raise an error. (e.g. "Cannot use `foobar' interactively with inactive region") A good default behavior would be to do nothing (#1), in keeping with the aim to use `transient-mark-mode' to govern things. These are essentially commands that never learned about `transient-mark-mode' and active regions. In general, there's little sense in turning on `transient-mark-mode' and wanting commands to act on the INactive region. * For named commands at least, we could add an ability to override the defcustom behavior for particular commands: (put 'foobar 'inactive-region-command-action 'error)