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: POLL: make C-x o transient Date: Sat, 30 Jan 2021 20:47:31 +0000 Message-ID: References: <2EFBBE54-62F4-4373-82D6-DC8750B648BA@kuaishou.com> <87eei9xb5r.fsf@mail.linkov.net> <87sg6m5mjs.fsf@mail.linkov.net> <8735ykc37u.fsf@mail.linkov.net> <938445fec66b0cdb0c4e@heytings.org> <87y2gchcpm.fsf@posteo.net> <5bbae1bd19ade73394fb@heytings.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="38247"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Gregory Heytings Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jan 30 21:48:54 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 1l5xAs-0009r7-Hn for ged-emacs-devel@m.gmane-mx.org; Sat, 30 Jan 2021 21:48:54 +0100 Original-Received: from localhost ([::1]:45920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5xAr-0000dX-I2 for ged-emacs-devel@m.gmane-mx.org; Sat, 30 Jan 2021 15:48:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5x9l-00087Q-4P for emacs-devel@gnu.org; Sat, 30 Jan 2021 15:47:45 -0500 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:53956) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5x9i-0002iE-44 for emacs-devel@gnu.org; Sat, 30 Jan 2021 15:47:44 -0500 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10UKji6P189334; Sat, 30 Jan 2021 20:47:35 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=qDI7WDwBeRkm9id+ayXJpu6eeUvS3FD9iON7OV2bh14=; b=loW8bMNCzDrHU4MsWfpmxT6PcIb+Ei1k1iaFuafPzPMCPcSInOWQiKc+XWfYKlx7BkRN oxqKZwuxSQ5zsz9VGYucNJEVIitbRZ+eY+0+NLy6lNxOo7X9Cdas7709B5AHCjuwiZuV wz+AMMVbeXT5IQl7XCvlX45K8PJeTqH9y+hhPEqr8T+f+IaVYkQXgBsAczowKU2pl73B pdB2btyHBe11+GY1JbpjnWjbd+JpWvg2yYp66Vj1/08svyznwflgG5zUnU43nKcMHDnO ZXJK9UgiDddbWnXs+oe43QHDIIgTwPPfSz+GVaNYG/AcLg3g1wTg89a6Xje77UEgyJL/ rQ== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 36cydkh52x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 30 Jan 2021 20:47:34 +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 10UKe1Sc043139; Sat, 30 Jan 2021 20:47:34 GMT Original-Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2171.outbound.protection.outlook.com [104.47.58.171]) by userp3020.oracle.com with ESMTP id 36cxsgwj72-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 30 Jan 2021 20:47:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q2BqD9WxNLOniGVy+BcZmpCuaz0O/mV1Ql38NxFLjAIQPJwKc5DeqgqdU5eNPQSh8le9vb06uoZhXXZDx1y/M242uRViQcxf6yqMlz3pm90GCJBbNHTfadgoFh9RN6THBHaA4S6wZ6OPgYbpW6P0l2MBCjD4tnAOLWoonzGyJl/mo5cny8o2fujwbEUbaOPW6wlPUgEreaatH3GKY3bWxscnep/Vc7i1CuPRO45fvNhaH4Kyks7QftGn/NTToTCjJ3p+BYQDa2P7Ee5GNY8y0J7gYvqV29C9x23PEpqZE3zlWwDU6e1d5ZCIh02OqTmdJATgTKm1/pfu18+Ls33q8Q== 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=qDI7WDwBeRkm9id+ayXJpu6eeUvS3FD9iON7OV2bh14=; b=mT0RBPi8b8jUeV/ZD7AlbsUWI+pTX0mviMnulu3IJyiIVvUKbCVtBz3hUfVRdmglstxnn+9TmkyN5pRrTSTGLAfoea7hN0PiQWA7XtxOpXdnS5Ltn7FBxO1W2k+wH8dY7YQFzvP02rRnzE5PwjUAckbwwHggTEFJug9N0zRXQY9Yuvni/tjg9cJDHFpReLaVW4mP42ZqAqgDftZEqpiCJ2OR9T304j5Yxmox+kWHiadR3zBhn3PhE2nP1JvCcO7nLkjt432pkJZmR+V5ZGR5Pa/NCIbrGIuKwO+FvUa4GHiJDyqv1FXgn7scxHwnClQDQVo5+1Pb3hIhmOv55sW8nw== 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=qDI7WDwBeRkm9id+ayXJpu6eeUvS3FD9iON7OV2bh14=; b=NgMjmS8C2oIh8SL4UWn3QGoCFyeKV5aUIY+BwxgULeAIhht+fmPBf+aKsoEJM6XOAQHvWfqjQ8vd1p3OwplUkVpl8aNefH3YGu6fVPM/fI8/MZafA9Zfya4dTAfMiHWmPoh1GphG14N6kTSFYECLcFimoFaXb6N+q7oGkzmII4k= Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com (2603:10b6:806:11b::15) by SN6PR10MB2590.namprd10.prod.outlook.com (2603:10b6:805:45::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.16; Sat, 30 Jan 2021 20:47:31 +0000 Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::dc4d:9cd0:2010:daa2]) by SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::dc4d:9cd0:2010:daa2%7]) with mapi id 15.20.3805.024; Sat, 30 Jan 2021 20:47:31 +0000 Thread-Topic: [External] : Re: POLL: make C-x o transient Thread-Index: AQHW9xISdbw+8VJ06E+1mMtePWtZLapAiA+Q In-Reply-To: <5bbae1bd19ade73394fb@heytings.org> Accept-Language: en-US Content-Language: en-US authentication-results: heytings.org; dkim=none (message not signed) header.d=none;heytings.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: 7bbe9edb-c0f7-47a5-d009-08d8c5604363 x-ms-traffictypediagnostic: SN6PR10MB2590: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FxwjO+ZkvhGCnYcy0LlzA9rIlY0XGMymZs/qxMZoXqURHCxzUBhkLZYDixkN6dxfP4WJ0fUk5pWkSnXJfHE+hpVe0coEQp4vSua3Vn71hizPoPN2ghkWCY2gdYMfQq6leCAPnU2e1t6CetVPcptGkg0DZH8IT3WmU5tc1D1KhhXnR7XIe3A8GNtWzoVKDCykabPPV9I+C5VoGnXW+lwjrK/6iGIQ2w4Ko2ZIknWnCEbT8+AMS9XbyWva2qHAct758gXIVUxkcuhKns7vi/pE8JYchvyLE9Ty5dva3n0qaVd/OUwmFf8p08vMlURm/OI0BW6bqjpxcZrrGN8XnVN4tYONwzNGNBPoeeR3q0qWhUX6OysAv/XLTJCyyG53TgBaSssrdshFFcQV9JTKCgDjxnHa/FhcgTXUrUX1YpTXVuDD9Gn1/HZKgUzZbe+EEcwn5M9ZRS4WS1rYTMwALEQWE2IyItWN5biJsOtrXRqZ903CstdQWx5GbnDaqgJCqAURpak31js9O6tvSWsOEqJ2QA== 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:(396003)(136003)(346002)(376002)(39860400002)(366004)(55016002)(8936002)(83380400001)(8676002)(71200400001)(33656002)(2906002)(9686003)(86362001)(52536014)(64756008)(66476007)(44832011)(66446008)(316002)(66946007)(7696005)(186003)(6916009)(6506007)(4326008)(76116006)(66556008)(5660300002)(26005)(478600001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?0lFIuwqhLT5CP4arXQ+06QUKn2UkMKGO+2/xn1GbMK2vrJ6+vn9ge1+dVU2M?= =?us-ascii?Q?owbS0DHETRrfHw6EH5ZMjkKXvZfD21dfqFVwlpxOxNPdIRk0msjBEinVP8S5?= =?us-ascii?Q?bJwPC9aVAdD0fW7BXZtxFqOO9Im1c/qqYr5s1EbmR37pT0WwtXkyHDTny6OH?= =?us-ascii?Q?WArg09CNvLF5A8su22P+3bCTBF8rcrlmKiLN4kntp/nsshCRuRYOJSGqHFaF?= =?us-ascii?Q?WycIBrdBy3jIFQTNK/pIxRDntJ0BDprL8iNZ67CRjGXLIBR4fu1ZuDS5zpI6?= =?us-ascii?Q?gyVcPL+Fgx4I2na+GT2b7bFMS487eTVTi8gKAKKN+h/s2zb9mfEKc70g+I8x?= =?us-ascii?Q?5j3aMIfyY5WYiWWca7wPITGRM/U2s/S8WjJfGaHPOLpouiB3HgaBTPlK+dJ9?= =?us-ascii?Q?snde5Tq0rwAgtauH4ckW+4NkDF1qacu6UxjDYe4e49mnYeU/q/kfHEDq9Fq5?= =?us-ascii?Q?ZXpGMYcFSdUtr+ZGKDmHvqzp+VoZZ91JlX9HfFfyxpFsY1RPUjNciUOJVlE3?= =?us-ascii?Q?FMGQ+6h72a9AkxragMFUWi3BOmIzVUYYl8A27rYSo+kLF9wnjIc+TBVL96/B?= =?us-ascii?Q?rz+wx87xsxEfohou2ArFuWVs8iEK0Galn6feTVwqBZFOZhojaT0pHbiz7iPt?= =?us-ascii?Q?m12P 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: 7bbe9edb-c0f7-47a5-d009-08d8c5604363 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2021 20:47:31.0315 (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: mGhipZ/Xei6Jx9+boXdawzYJSk7YyNoWVjOXN0ipsPgE5kx2ToJ6VzEaV4MQZ1OFDoH0X+tbk3sEAFatMMqxWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB2590 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9880 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101300114 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9880 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 adultscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101300114 Received-SPF: pass client-ip=141.146.126.78; envelope-from=drew.adams@oracle.com; helo=aserp2120.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_H2=-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:263640 Archived-At: > >>> It is to bind C-=3D to the existing "repeat" command, > >> > >> FWIW, I agree that `repeat` deserves a single-key bindings. > >> But I don't think `C-=3D` can be it, and I don't have a counter-offer. > > > > 1. Why is it important to save one keystroke, just > > to initiate repetition? > > > > What's important is to be able to repeat using a simple, > > single keystroke. But to initiate repetition it's not > > important to use a single keystroke (IMO). >=20 > As I already said twice, it is important because otherwise you cannot > change the prefix argument between two repetitions, which is a very > useful (i[f] not necessary) feature for a repeat command. Indeed, as you admit, that's _not_ a necessary feature for a repeatable command. And that use case is certainly (IMO) no justification for dedicating a new default key binding. I don't consider it an "important" reason for sacrificing a repeatable key by default. Anyone, or any library, that _really_ needs, in some particular case, to be able to optionally use a prefix arg on _only some_ particular repetitions can do what's needed for that. This (for me) is about _not wasting keys_: not having Emacs needlessly appropriate more keys for default bindings. If you dedicate a repeatable key such as `C-=3D' for a NON-repeatable action such as this -- and INITIATING repetition of the last command is a NON-repeatable action -- you're wasting the chance for that key to be used for a repeatable action. The _much_ more common use case for a repeatable command is to be able to use the same prefix arg for each repetition - i.e., pass the prefix arg at the beginning. And that use case is satisfied, I assume, by your definition using transient. At least it should be. It's satisfied currently by `C-x z': `C-2 M-f C-x z z z...' moves forward two words at each repetition. If your definition of repeatable commands using transient doesn't do that yet (I haven't checked) it should. And if for some reason it can't, that functionality is easily provided for any non-repeatable command by a repeatable-command-defining function such as this: (defun my-repeat-command (command) "Repeat COMMAND." (require 'repeat) (let ((repeat-previous-repeated-command command) (repeat-message-function #'ignore) (last-repeatable-command 'repeat)) (repeat nil))) (defun foo (arg) (interactive "P") ...) ;; Repeat `foo', passing it prefix-arg ARG. (defun foo-repeatable (arg) (interactive "P") (my-repeat-command 'foo)) [The msg that started this thread used `set-transient-map' to do the same kind of thing. The original proposal, which I applauded, was just to bind `C-x o' to a repeatable version of `other-window', so `C-x o o o...'.] > Another reason (mentioned by Sean Whitton) is that repeating with the > last key of a keystroke leads to commands being called when what you want= to > do is to type the character.... [Y]ou have to remind that you need to > quit the transient keymap with C-g before typing '{'. Nah. That's just pilot error - not being used to it yet. That's no different from ending Isearch. You type { thinking you'll insert { in the buffer. But since you're still isearching it's instead added to the search string. That's a minor gotcha that's easily, unconsciously, learned and overcome. > > 2. That said, for _specific commands_, which are > > already bound to keys, I think it's very helpful > > for some such commands to themselves be repeatable. >=20 > That requires a lot more changes: it is necessary to adapt each > individual command, including user-defined commands, to make it repeatabl= e. I think I was clear that it's NOT either/or: * EITHER (1) provide a general key to repeat any action (which we already have with `C-x z', and which you want to put on a new single keystroke, e.g. `C-=3D') * OR (2) replace some non-repeatable commands currently bound to keys by repeatable versions of them. You're trying to change my statement that, (1) when useful for some particular commands, they can be made repeatable and kept on their existing keys, into (2) a supposed need to do that for all commands. I'm not in favor of needlessly sacrificing more keys, by default. Not even one - for this. `C-x z' is fine. It's superior to `C-=3D' because it's not a repeatable key (and `C-=3D' is). And any particular repeatable command that needs/merits a single keystroke can be bound by anyone. My point there was about non-repeatable commands _already_ bound to repeatable keys. It's a waste for a key such as `C-e' to be bound to a non-repeatable command - it could just as easily be bound to a repeatable version of the same action. That's all. I'd much sooner just hold down Control and repeat `e' (i.e., `C-e C-e...'), or even use `C-e C-x z z...', than use either `C-e C-=3D C-=3D C-=3D...' (which I think you proposed?) or `C-e C-=3D e e...'. Replacing `C-x z' by `C-=3D' -- or by any other single key -- gains nothing (AFAICS). The act of initiating repetition of the preceding action is NOT itself a repeatable action. That just wastes a repeatable key, `C-=3D', for a non-repeatable action.