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: Updating *Completions* as you type Date: Wed, 18 Oct 2023 03:04:27 +0000 Message-ID: References: <87bkd3z9bi.fsf@catern.com> <86cyxjyr1y.fsf@mail.linkov.net> <86r0lxm7um.fsf@mail.linkov.net> <87sf6dx954.fsf@catern.com> <87ttqpwea9.fsf@catern.com> <86wmvlw178.fsf@mail.linkov.net> <87bkcwx3ft.fsf@catern.com> 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="27673"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: Spencer Baugh , Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 18 05:05:27 2023 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 1qswsA-0006yx-HN for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Oct 2023 05:05:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qswrR-00073V-2g; Tue, 17 Oct 2023 23:04:41 -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 1qswrP-00071d-GU for emacs-devel@gnu.org; Tue, 17 Oct 2023 23:04:39 -0400 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qswrN-0001nH-4j for emacs-devel@gnu.org; Tue, 17 Oct 2023 23:04:39 -0400 Original-Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39HJxHOb018395; Wed, 18 Oct 2023 03:04:31 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=M2RYcG4bejBs8J80O9nF4hs0u2LAXYBoy2lhTvwALkw=; b=uKiilDOZXeD4mP+NPxYvN9fCSahqAcz7EIpmP3PuFZIgvWOS+n5BpnKNS6VHMpoEzQb1 sY5kWN+4jqtSBtQViM0WhxzwfZlXPQMFuYwYfZIPtCUuHZUmna/kdim/reSugRcGbcrB Z3yCIVQjXYZAiYyiRmrdOgmiVbLGEaup3C6BnL2TiYQa6ZeXegZuP3KHpagwS9U+Y1ZM QGhQG3m1L9hBxaRge0VPIQlB5sye0JsInSK39PPktYcT0xuJVMvD/gxsNfnS4FnH2QbO OjCcVdYyLUpu7MUQhROOdTRyJArzMmAQcRJ/Y2swP8Uok/PgH3uZ0EL3gTJ0A+HXT6sy 1Q== Original-Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tqkhu6kc8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Oct 2023 03:04:31 +0000 Original-Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39I1M8T4015255; Wed, 18 Oct 2023 03:04:30 GMT Original-Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2040.outbound.protection.outlook.com [104.47.56.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3trg1fw3jf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Oct 2023 03:04:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cajdhRSwZIAxW+HVNSxbkDP98d9mQAseFOT35QTSxVZcgy4GxqIgwIsRBKssjinTGqJzyBbeaJabDvV11shGhi8J/wS1rvdnTkEB44DmslXva6Tk43OHG4qdBZgFgi7NWu1BBM75OmbTZWw/UPV+Rz+Uky4nH6AuzctvejnQk2X3jddyjvQ9hRINTtsriOSIxP8Q+rY1+XahjsF1dqFFC7aBDxoxp8Tuc38T5WriEdALwSGvR5A7uuV0o19k+5FAkj/KFasJz7GOxaedIQC/7BBnu3Om7YHQ+L1j797uClvO1kdN9l+YgGteB36DA5zRgC8IC+Y6FiRX5FyHvpQnFQ== 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=M2RYcG4bejBs8J80O9nF4hs0u2LAXYBoy2lhTvwALkw=; b=HP1PPCJKuefl+Adk3jDhiFNW89P8WAT2W+kyhjrQ7mmkY5Az+ZgXwPMWVEUmg+ke67br3UF9tGeekNja1CwBgclPDknulH5dzW6WNnkUiqoa+FZG0BlcPAd8k8AXci4FltQGFwni6swbwUY7pb6iNfh+j3ji501CX19G9/irLjdTRcIqTYB7gyEn02ahhQ6CrPw/oZlxbXdigZfNQiS7ERGa2+/I6hEpZSY1Vi4IpIgedjXFLN7OQ/TpetL2CCIgv2yBoCoai0ZOKYDzyxbD3HVjPRkERG7/3Yu9zrA6SWuHyQVJzaKUaewzhyKOehgvSLQ50a8oUJLDSG8Iwb7bJQ== 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=M2RYcG4bejBs8J80O9nF4hs0u2LAXYBoy2lhTvwALkw=; b=rpsSvVPWHv3qydarnHtE9QHlTUzm1ZBhjX2N4FOu/L8qma8M9b1+7gKS9SUEsgzYp8Poqxi1ZcS9+e3voZy12+Yau8MCTiVuli2iOCa0fuVnnIGURdiSj0r3dZWUpzxUDTmue2jqOVy0d+tvt8NcN4zgmLywH/2XIY+kYfl80d0= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by SJ2PR10MB7557.namprd10.prod.outlook.com (2603:10b6:a03:538::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.21; Wed, 18 Oct 2023 03:04:28 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::adae:506b:e9a0:529f]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::adae:506b:e9a0:529f%6]) with mapi id 15.20.6886.034; Wed, 18 Oct 2023 03:04:27 +0000 Thread-Topic: [External] : Re: Updating *Completions* as you type Thread-Index: AQHaAU1xq6wIhLLvb02GqQT1XqTqiLBOyi2A In-Reply-To: <87bkcwx3ft.fsf@catern.com> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|SJ2PR10MB7557:EE_ x-ms-office365-filtering-correlation-id: c22cbc74-4240-455b-4ce7-08dbcf86f0cc x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: u2YTG/QB8IBiUcNp3ih/a/hd9qRcfV2Jgn9NNWKQXNxwd+iNp2nveK7uCx7jM2MJgBlEXigtm3NS9Rq78SeBRDd3GyuQ192O/3WmUmNC4yKq3UJVA5pce2tgYflHUF2KVuBXJ92omLhPg4k/Ml+xmHyyHLt4YnmN8TqRb98q3BT+a+WZnp9+05ULBMKTCsXNkqzPqyEjSG5mqpZ0JgvUyYArBVVuMSTqG1pIgF8JbuwQmvOyCFHdschCqRvfRjmo+aws1OyFlTB1bEFPzf+vtQT4tBzdymsr5+29Sgco1+rpAd9QBAtwo+dhbUz+TPjWhrqAJmH5OzMGa0SBnZcf0QDNATz/cckoWgGisfNuSudbMZRM6cTTTd5KF/hmsrg7RYQ2Fwwp0OoD44ROwmN9nNI2sAzPZvx5+WIFvKSBunG40aYTLf3yXnlAFtARxSJZuED8tzhJC/0JVqMaDQJT3LuHMEyCmjm9Qd6rSwOupJlaC48v37Jr8R3JpyZETavNQapYzd8dnvFHXoDLFfZqyV5wmgUNr3DENfg4C53LlnlW7GeTZa/TrGF31tePHrXZ6sg5ra3JK62d7Guby7m+TfYUJ5gucYNeL6cQZJkmFxvUW+hzritjyyygN+IWICtg 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:(13230031)(39860400002)(136003)(346002)(396003)(366004)(376002)(230922051799003)(1800799009)(451199024)(186009)(64100799003)(26005)(55016003)(71200400001)(6506007)(7696005)(966005)(8936002)(83380400001)(52536014)(5660300002)(4326008)(41300700001)(44832011)(8676002)(478600001)(2906002)(316002)(76116006)(66476007)(66946007)(64756008)(110136005)(66446008)(66556008)(122000001)(38070700005)(86362001)(38100700002)(33656002)(9686003)(569784001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1fl/YxHgg4gHU7BgIg+897vQHQFjiaLPisyBD0EbtuJbsJoSHozVf5d4HYVC?= =?us-ascii?Q?G5j0bsvPr9C7hV496MPODw8JMFuSbJ24+m3kek9IXnwcCv51CVpLq+fS8KXu?= =?us-ascii?Q?uyT9Oc+vQCmGBxQf0XWx6LSq8IT/Ujv7MemPXmjSGXfpHvGbNTytqQgL/LZx?= =?us-ascii?Q?Pbt9SmnganjZOumrgWD2CJmljnYwEoH5PSi8DK8UgElniqaxysKobyHNgyyG?= =?us-ascii?Q?H7x8i+tRbIG7fCcJ2RkDYbT/9nXZoAPZRLO35gzBPAFvPue9g+eqVyhTMKQ0?= =?us-ascii?Q?nW+Tzq+MjC3IUiyIqtNTdhQAU7cgnNEeS7GK3PBRE/sKhszoegmADAe15Wps?= =?us-ascii?Q?5syHbaq9aMZbZisI+rO+qcIOyCY7jiLLLvmSJticsboYZ5LCzGpq+w8yfvrE?= =?us-ascii?Q?zI0oDvgYMYFs0si4sgCDPD01YBnQhe4PbSPeqe1BBBBTHmrpVPtyQinKTSok?= =?us-ascii?Q?MQnsepgcIQkQ8ZSRlqtIFqg/UHO5SBvyystVw/6KgTj8MIj4RBrYGkkuDK9W?= =?us-ascii?Q?lmHdwavyp8ZNb//2DhLjTrDzjTT9IW5OLVXhj7Seceyfz4rKCeQx13kdU1Ip?= =?us-ascii?Q?ihZRa7JNvpUda0Vu4/p0QoAwSAfxeAtXCsmWhd8nzNfIivg3EULwNgG0rUz7?= =?us-ascii?Q?RY X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: vC7OA1UlRexHIiL46CJG4adCZ1Clsl6ATCwoMuH4Nwk1hXaVMiAoCuKlaX+u2zopsbLa2tNkiL+Bkli8J1JMfSPZpjXi/sZsknVCjZOdlK+G6cJ1REJJsp6PiObVjYztogbgCSKc0cd4NWyCG49odXCXlrfzvlaWruKnstO90WOZZwJyIQYOIP5z/uwO1QOeco1YYt+7enAofkUpc+9UPjySFWTTZnbdvLtfjdFvkNIJ2MVMiyrXjUDWSYGaAt+WTEbNrnetuwXla/SgktPg8YUIi5wyXV0vVGLpwsGsjlu3qt1vnAXvf52nqELiGdtfXahg8iLuodlwDnasjqsOOfPmo52pNPJByZ8vTmNdkUs+X/Euzufqiw4ihjS8Y9/DYr6O0p9lWn+CQW65ZQbskWonoXCE/jK8Gw9QcZnwbSaZcNhr0tzETryKBkeJXaLadtL3Qt8e7i/p7s596nVCOGE1rY8Cpb7QLWr8LZm27Md68M3yYWblJT+VPf6MURcLX4LWtO0nCZgxgrXAep9+BgIWEEsCcWiBzg203/zmfKgDRKHHezl4AuEXfrriNveCCijyxvoLgEog3UFWEo3PPHdq0Za/18Ryx0/KJUXOU/Aqp93j716HCWfbH8nOwragHgV8i8GtyCWICXjs35tOCW+quzexh904jfbN8BiOigVKc/tde/iyD+p40Xh9hVuRp/n6j+Cmq+4z7BSHrDNRV1ldOh4G2HtCd9jJz9JKW1ysGD 1n8wEFHwc3osSZG0g2l/HbX3US6S8ndAGmoWYKufqC/icMdcoPs4LKGi4m1+A= 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: c22cbc74-4240-455b-4ce7-08dbcf86f0cc X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Oct 2023 03:04:27.5404 (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: ruxshZ74RuNuAxfk+vo+y3YethCgKKfAjXng66MzuTvnAO+sDm0OB0nFg5yk8U273P3Sp1V7K2KCywsVqIqkUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR10MB7557 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-17_08,2023-10-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxscore=0 mlxlogscore=939 bulkscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310180025 X-Proofpoint-GUID: izyWEE5MYqzLCxTVuFPSbhltvEd-PbsK X-Proofpoint-ORIG-GUID: izyWEE5MYqzLCxTVuFPSbhltvEd-PbsK Received-SPF: pass client-ip=205.220.165.32; envelope-from=drew.adams@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:311553 Archived-At: > > I think we should choose a key to toggle completion=20 > > type between history/default/regular completion. >=20 > That works too of course, although it causes some=20 > more proliferation of keys. The approach I took in Icicles is preferable, IMO. Food for thought: 1. There can be any number of sort orders to choose from at any given time, i.e., in any given context. For different calls to `completing-read' (e.g. for different commands), some very different sort orders can make sense. And one of the available ways of sorting is to do nothing - NOT sort the available candidates. This can be useful if the completion function already provides them in a useful order, or if any sorting at all would be expensive for some reason. 2. Instead of wasting multiple keys, one for each sort-order choice, a single key cycles among them: `C-,'. 3. For any `completing-read' call there can also be a set of alternative sort orders. You can toggle to the current alternative sort using `C-M-,'. And you can cycle among the available alternative orders using `M-,' (just like `C-,'). 4. Both `C-,' and `M-,' also provide another way to choose a sort order, besides cycling to it: use completion to choose it by name. 5. You can choose, with an option, whether, by default, to (1) always use cycling to choose a sort order, (2) always use completion, or (3) cycle if there are fewer than N orders to choose from and complete if there are N or more. 6. Reversing the current sort order is just `C-,' with a numeric prefix arg, e.g., `C-9 C-,'. 7. Regardless of your user-option preference (#5), you can flip to the other kind of choosing as a one-off, on the fly, using a non-numeric prefix arg. E.g., if the option says to use cycling in the current situation then `C-u C-,' switches to choosing the order by name (completing). 8. It's very easy for users to define new sort orders. This is quite important, IMO. It should seem clear, from your discussion so far, why this makes sense. 9. The available sort orders for `C-,' are defined by a user option. But commands can adjust this list of possibilities by adding command-specific sort orders or removing some that might be inappropriate. 10. The sort order you last chose remains in effect for subsequent completion (e.g. other commands). But if the sort order isn't appropriate for some command it can turn sorting off, in which case `C-,' lets you choose an appropriate order.=20 11. IMO, there is no reason at all to have different sort orders for display and for cycling: `display-sort-function' and `cycle-sort-function'. At least I haven't seen (or heard) any reason. Can anyone say why these aren't the same thing in Emacs? And even if there were some use case where someone might want them to differ, why wouldn't the normal, default case be for them to be the same (synced)? You're apparently already beginning to wonder about a difference between a "current" completion in *Completions* (the one that's highlighted) and a "current" completion in the minibuffer, no? Why let them differ, ever - what's the use case? In my code (both Icicles and tiny `sortie.el') the two are the same. The current candidate in the minibuffer is always the candidate highlighted in *Completions* (and vice versa - identical). 12. The current sort order, and whether it's reversed, is indicated in the mode-line of *Completions*, so you always know what sauce you're being cooked in. https://www.emacswiki.org/emacs/Icicles_-_Completions_Display#SortOrder =20 13. I wonder if any of you have even looked at the doc describing the features I'm talking about. I get the impression you're maybe starting to re-invent the wheel, without looking at how existing round things have been rolling along so far. https://www.emacswiki.org/emacs/Icicles_-_Sorting_Candidates (Many of the same sorting features are available with `sortie.el' as with Icicles. Trying it with library `keysee.el' is a simple way to see what it's like.) https://www.emacswiki.org/emacs/Sortie https://www.emacswiki.org/emacs/KeySee