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: Stepping Back: A Wealth Of Completion systems Re: [ELPA] New package: vertico Date: Tue, 13 Apr 2021 02:06:17 +0000 Message-ID: References: <9c9af088-580f-9fb1-4d79-237a74ce605c@inventati.org> <874kgkxxs0.fsf@posteo.net> <87blamp5hy.fsf@posteo.net> <2ce73f33-8675-211a-9eb7-ea63de1a161e@yandex.ru> <871rbh6pd4.fsf@posteo.net> <87sg3w6co0.fsf@posteo.net> <87pmyz4xom.fsf@posteo.net> <87mtu3sc0v.fsf@ericabrahamsen.net> <87o8ejqqdr.fsf@ericabrahamsen.net> <87o8ejhy32.fsf@ericabrahamsen.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="1005"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic , Dmitry Gutov , "emacs-devel@gnu.org" To: Eric Abrahamsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 13 04:07:18 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 1lW8ST-0000AW-TC for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Apr 2021 04:07:18 +0200 Original-Received: from localhost ([::1]:60142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lW8SS-0006Tl-Uf for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Apr 2021 22:07:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lW8Rr-00063z-Qs for emacs-devel@gnu.org; Mon, 12 Apr 2021 22:06:39 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:59892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lW8Rp-0007b1-Bd for emacs-devel@gnu.org; Mon, 12 Apr 2021 22:06:39 -0400 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 13D20Zi1055313; Tue, 13 Apr 2021 02:06:19 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=0tC/UB3R5bhALDN6+9wQuy4qCyDfEtOK03p7595OcAs=; b=iaxuhwoyc1jkgZLxHqjGvZknmhXqXhlnuVjdQJdw4OSQpzP/BE+zxg1DDqYkzrthzT0h 1JNKAOVCNLtE0adEpxvbjFFUv/+NYA2RkakkWAPWHG6msz5Lw0E+u/CRV/rnBrh2xYB7 o28JtaSYpqxeYQ8ImEjasl/qmOLmxpGkDD1mpRjok4rrXVzK67Fmx3HK+KrBkTCd47jq soHi2hXZDtUhgL7q3uODsCwZt+eKJx5xparRPBPW8Lewkcz/L02qLL7+Dwl1roD9AlW5 bnuDYJKqFEJjd5+dLv+QP6RNfjGle8r4wPnSCCb+BzlKnbIcVA6XwU4FQcfL44+y22zr 8Q== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 37u3ymdgv6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Apr 2021 02:06:19 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13D20TJP183578; Tue, 13 Apr 2021 02:06:19 GMT Original-Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by aserp3030.oracle.com with ESMTP id 37unknwsj7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Apr 2021 02:06:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cEPYpPaldoAo/942RaAKQPqCU+Uugat7xy48USgJnO06CJ+HouJ5A+HW3a06ugD0uorODdDSUATdzzDfucDcolqQUaAW9gH+gFPfzHLE+yVpqQTbdlnHkufUGDN7366GvA/5pWQzuSfONwh0PottYWjVFbgfz995Gi5eehObo3EbmKIqK0Y2cMHBpppKfWshWxwHkMnL2a9i1xGuQ1rjH301lvcmNI1jaebmopl+qIV7dtjPnRcBi1uVdMfMFASrSjAnGrDOnuhHxa521033wrMg0WnuOcgj3APKjgGHqMsqK3wUfEJkZype3HsJBL44BwG3uqxMA4yl69zw1RvGoQ== 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=0tC/UB3R5bhALDN6+9wQuy4qCyDfEtOK03p7595OcAs=; b=PyA5aL07LNK/NnAjmJetKO42x2FKR26h1NGDztbHTo6ZSteP77MQwgh8wDkibqoyX7ECE9qFT+f99ywDTmfAquv1eMxWy2IPXE1VEfh0fgDVY9Yf5xt1rKPzOcCtdHpyo85nQXejgk/2CzL8aInNDRzLw9hGQpoYLF4Yk3JMtssHH2EsDOG1vi8nfVp1+qDdtHLc9H+UCpGlg8gkIxvqYFPD17UN4zxW6xZbzGUgG+iONW/4VFvJRtTfbFL/B5hNA20+eHLDwmwCs5raxF8wNuwYnD/Ghn3ZO5ui98t1SaRXU9REEnAZGB6IHrga6WZXhlRMK+M9GaOemiGejlC+gQ== 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=0tC/UB3R5bhALDN6+9wQuy4qCyDfEtOK03p7595OcAs=; b=K6Qk3yERIwvR49N30pd1Uh98Kjspo14OY1m+4nTZKO7sZ89sdQ3qjwUlMVLIRbIt+UDDhsIMNeWLg/I8cATFxjqGlTuAtoiF39QXLKNxBawYnU16NRcVxe7DnCzs8pEokAP+cOsITpDHXay/ILC7d0RJSu++1kvynAnyh/5JcCg= Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com (2603:10b6:806:11b::15) by SN6PR10MB2527.namprd10.prod.outlook.com (2603:10b6:805:48::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.22; Tue, 13 Apr 2021 02:06:17 +0000 Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::b8d2:db6d:3e4b:d315]) by SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::b8d2:db6d:3e4b:d315%5]) with mapi id 15.20.4020.022; Tue, 13 Apr 2021 02:06:17 +0000 Thread-Topic: [External] : Re: Stepping Back: A Wealth Of Completion systems Re: [ELPA] New package: vertico Thread-Index: AQHXL/UeYYyIcNtKcEiRmc52J3C186qxqfeg In-Reply-To: <87o8ejhy32.fsf@ericabrahamsen.net> Accept-Language: en-US Content-Language: en-US authentication-results: ericabrahamsen.net; dkim=none (message not signed) header.d=none;ericabrahamsen.net; 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: fd7f23e6-dfd0-4b0b-84d6-08d8fe20b92e x-ms-traffictypediagnostic: SN6PR10MB2527: 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: qK6BQPZy8mwnW4FmwToXmWaoHATS+dqGB+LP2GmXuMHhvYZrq8Tc4cAPFqsPdY4cw+b7Se9PF8NijN8PrrlbKPcvnMOLmH09c4yOYy1XlxMXTTHdsmlKp9eShq31lsLTA9xIukgZ0vzdZP3ERoXnzxG3Z0u1IJ7QKBuiVJBSGi6bffDAKCK23C41K4Tt+jLjSjhnwWnstw/bPsbe/HSlxTan0DDXh66LGs2jVq9FDLE2a28PDyeWII8FYjxFUTDhDLhJExSAX1jWNdoGUEOuAb1AuLynr5UN/3PSNoy20A3yNKrK28PMxXLg9Kgd26iM7o8Iwce/n+Q1MstTcjVZP8dtY1lKjdZ+1KXK12NskPGyOrS4ZdXXLF5GReeWIhOUE7t7MZwZCeWTjxHd4bpg1JfSxaTbybP18rt9Bo/p0hnRAg/BCCUDkxNG4W63TWEzSONRDnFQBjRP5VxxZee5rIuXaKSSor1QGHCp4vk1UZOvhlBQcFs/7LcFoc/072Bt1bmmZG7da6FiNNpNtrCVc4A0HYMyuy0arSbc5VJk/zmEBZtvy6ob4CVTEa1FadwdIizc6LVwfqRrs5sQeM7qUUcRXpn8bSnerHOT+//fwlVYtrOGeXGEGESWCMb4bTYWcfScm7jgHpPa52ziLgMaew== 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:(366004)(346002)(136003)(396003)(376002)(39860400002)(66476007)(76116006)(64756008)(66446008)(66946007)(7696005)(5660300002)(52536014)(66556008)(8676002)(54906003)(86362001)(186003)(6506007)(8936002)(478600001)(316002)(38100700002)(2906002)(4326008)(55016002)(6916009)(26005)(83380400001)(9686003)(44832011)(71200400001)(33656002)(122000001)(14263002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?TkKQHhiFKvNwoOK9FKSwhFsNqjyXzqZL4lvvknfq9Dtg5PkPz2OH2G3Pymc4?= =?us-ascii?Q?q12BgFQXRbxI3jZrbLT1yw/ge26nPeZurssR94EKg7CdxYgAiAvPJmUkR/Ob?= =?us-ascii?Q?ku5+0cDh8NrWuVSExTaR9Xk79sdiXZ+GRaeT9pEgiLsovthS5VPVKsEkT0OB?= =?us-ascii?Q?3Nz+FhLEr25iEpOT7Z4X2xwmIngfXxIL1UPprJnB/BhUIFiChssvVDSZtmPa?= =?us-ascii?Q?WUjdH4/v7hdMDT2Vp8IsF4OO7KGKUpSSY895zogdaSgMS8NISBXtXiRSSsAQ?= =?us-ascii?Q?sQ8dow+3VP+pScEo18vZ74+TyMnKXeedI9pIV8/tHgnowflDHLDf+K+ERi2y?= =?us-ascii?Q?WfMp+65IYqCLi8LpEu1o6y+PDQ4J9NH2sM7hpvrQ00+Q6cxidDuMpTbH05ZX?= =?us-ascii?Q?884remKPUSTb2fpW5RO8pabANCyMLYy4aLOcpr/s4vyAxJo69Z0bQakLjzz6?= =?us-ascii?Q?XYgXHDzurvdS9/b+Lf4R5GJKbwN7t6iV4ZQmMGlYJY+wmVrGILyTrB2w4Juc?= =?us-ascii?Q?roaPCZxD8GsBwTB3obczN6uaZh8F0g3SRcj0dypr9RdPLZavwBZPE13pDysh?= =?us-ascii?Q?xMdOId9zqCJ3T905I8Eq1s2FTNMgUjef/LWcA4wRHnEs74gSMw2bxSXI85t2?= =?us-ascii?Q?kgKd 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: fd7f23e6-dfd0-4b0b-84d6-08d8fe20b92e X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Apr 2021 02:06:17.1042 (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: e2kPlLw5wknJOelz8DHPkGX/kzuuAkryStLwkr6jZG8Vs8NCC15M1PAwJ0VJI6SoFNnHIECvfTy0xxthGHEM6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB2527 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9952 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 malwarescore=0 mlxscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104130012 X-Proofpoint-GUID: OuraCzgRe5j5xCWj-misRI6iPlMX-FXd X-Proofpoint-ORIG-GUID: OuraCzgRe5j5xCWj-misRI6iPlMX-FXd X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9952 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 bulkscore=0 phishscore=0 suspectscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104130012 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, 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:267984 Archived-At: > >> > I already mentioned that you can put the _full_ candidate > >> > -- whatever Lisp object it might be -- on the _display_ > >> > candidate, which is just a string. > >> > >> I missed that the first time around! That's an interesting approach, a= nd > >> one that hadn't occurred to me. In the simplest case it ends up being > >> way, way more code than just referencing the alist again, > > > > Why do you think so? You have the string; you just use > > `get-text-property' to get from it anything you need. > > > > (Not to mention that looking up a key in an alist (1) > > takes time and (2) doesn't allow for duplicate keys.) >=20 > I mean that using `put-text-property' on one side of the > `completing-read' and `get-text-property' on the other is more code > (okay, maybe I was exaggerating, but it's still more code) than building > an alist on one side of the `completing-read' and then using > (cdr (assoc-string on the other. There may be other advantages to the > approach, but what I'd like to see is `completing-read' (or > `selecting-read') doing this job itself. I don't think you're right about the relative work/code in those two cases, but I won't argue about that. I will say (again) that (cdr (assoc-string...)) won't deal with duplicate keys. You or someone else spoke of unique objects. Alist keys are not, in general, unique, even when alist elements might be. That's one reason I use the approach I described (when I use it). =20 Here's the doc string of a function I use to get the full alist candidate that corresponds to a STRING display candidate. You can see that having the full candidate on the string as a text property is one case - true some of of the time. In other cases I don't do that. ,---- | icicle-get-alist-candidate is a compiled Lisp function in | 'icicles-fn.el'. |=20 | (icicle-get-alist-candidate STRING &optional NO-ERROR-P) |=20 | Return full completion candidate that corresponds to displayed STRING. | STRING is the name of the candidate, as shown in `*Completions*'. | Non-nil optional argument NO-ERROR-P means display a message and | return nil instead of raising an error if STRING is ambiguous. | If the value of NO-ERROR-P is `no-error-no-msg', then show no message | and just return nil. |=20 | If `icicle-whole-candidate-as-text-prop-p' is non-nil, then the full | candidate might be available as text property `icicle-whole-candidate' | of STRING. If so, then that is used. |=20 | Otherwise, the full candidate is obtained from | `icicle-candidates-alist'. In this case: | If the user cycled among candidates or used `mouse-2', then use the | current candidate number, and ignore STRING. | Otherwise: | If only one candidate matches STRING, use that. | Else respect NO-ERROR-P and tell user to use cycling or `mouse-2'. `---- [FWIW, I don't want completing-read to do any such thing in all cases. Maybe you meant on demand, e.g., with some new arg. I do it on demand, indicating when I want/need it by binding `icicle-whole-candidate-as-text-prop-p'. And yes, it's done in the Icicle mode version of `completing-read'.]