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] : [PATCH] Completion preview common Date: Sun, 7 Apr 2024 21:15:32 +0000 Message-ID: References: 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="6253"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "me@eshelyaron.com" To: Ergus , "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 07 23:16:15 2024 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 1rtZs7-0001Km-Ew for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Apr 2024 23:16:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtZri-0006vx-9q; Sun, 07 Apr 2024 17:15:50 -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 1rtZrc-0006uY-O5 for emacs-devel@gnu.org; Sun, 07 Apr 2024 17:15:48 -0400 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtZra-0003Eg-I5 for emacs-devel@gnu.org; Sun, 07 Apr 2024 17:15:44 -0400 Original-Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 437L1NNI027714; Sun, 7 Apr 2024 21:15: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-2023-11-20; bh=5n8QqteMiDiy24kO5xr7FzfdjfIFkFgG67fg6QGyaj0=; b=bxdhJhunHwv2iFeGkimTLJbiOAdIRlpN+SUrpTZBmeReFbxMqFzjZVpyB4NzPIIaVk0M HVKSPbKm94WPmf/S91mcAponH5jhZ3Vg5KuvR/lCtNGZcBp6JsZbqWK9Lrh3qa+7PxwH LrLbvZmRXM0RVkm3sF6JLdOkhMzRebRNcxShoHC1XLmkzb7UmFclBt6AS5/j8D4gvPhb ztCLGlA9f+RBo6wKrGIXZzsmhC/FivdKtAx7jOh96GkgSrnxhh4pF9aJn3L2y/F9dXW9 l/uThI5q9ideM5xHJW8jcj7Q/ozY9DsbaKqIk1oms9eFva1l5ewUSdvbpjyaneymbiO/ EA== 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 3xax0uhdcq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 07 Apr 2024 21:15:35 +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 437KnrrT010765; Sun, 7 Apr 2024 21:15:34 GMT Original-Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xavu4qwkm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 07 Apr 2024 21:15:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ydb72k41fp0uo4gMYIeAkCcQg2HCCuiy4SDq9vI9/y1ml3Pc4pq8fzaQ9DP7P15VG8sw6iLBmy1DhzcttlcSsa9ni7LEBokNOACts/04b7vyefiuHlEiohCHjtug9pQdHmVADG+w4YEeSybPCtot7/gmIt9s32ZoHVWcZPthbzmgMqu12Y9/5+OAXTbqP9tT7DHQvKY5ltsfXaURqWjNvHxGGIpo7022KkzGse7IGs7hw3W0BHiJlBxMp5sCjc6xKxGyRFL9AE7qbGkKMpVEJZNDqfmFAaLMzqYfddbIgAa6BaeV3x+A3QNH+dUJbFfLCEboGUvYYxWfOFilTYrNIQ== 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=5n8QqteMiDiy24kO5xr7FzfdjfIFkFgG67fg6QGyaj0=; b=O0a9umRUsWHyPTwYQ4HIyg+2VmHYFqh4+eWuWARTXrI8BuitEEBdjtsucTF8aipi1Xuh1sVQq2HoIMu6UrcijV7+oWUZ83XP+qihEjSdCBNHOFA/rQjao5se8IJhkEnMvUGAZMOG5V/3D/QT+lPiVKDQm8VDL8cr/Rvq+etYfh3dUXFp4MfAM+U1ACMpqx5jtl5bvZARUniN9SP9vzHsZD8kchnd+THMFXMgoSGE/uLeaBXR3L8TKCNtsqHDl2DlUhpHNhQekMbys/kYTxkfrMQEP47hn1B5YpaJk/fMrF344WnEKM2JqtPC0/szZzN6Xz7h3NbcGfSD/ZADLbxB1Q== 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=5n8QqteMiDiy24kO5xr7FzfdjfIFkFgG67fg6QGyaj0=; b=XdyrAIjOh0eJ+ITmYC3RgqZ3nx/umsWCgKei/c6UQ/ng4/SfggTWJ/eb7BcDbj8b+x+KEvGQCN5QKGMeH0qe4+XeG0ZZpQEjzwv4MntFNdNPlrqGe1ZKg4FmjLuGx+Xq+qi6kSWS+v1uLmBaWTaM6ssfnR4cSkAEenMc9Hwed4Q= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by DM4PR10MB6717.namprd10.prod.outlook.com (2603:10b6:8:113::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Sun, 7 Apr 2024 21:15:33 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::d9bc:c5bb:7fc4:cf9f]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::d9bc:c5bb:7fc4:cf9f%6]) with mapi id 15.20.7409.042; Sun, 7 Apr 2024 21:15:32 +0000 Thread-Topic: [External] : [PATCH] Completion preview common Thread-Index: AQHaiRrTq8tpLw/UNECWkqj+P3Kru7FdSgUw In-Reply-To: Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|DM4PR10MB6717:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: j5JuShRljigTgXCpoSAjVC8U4G9xngEo8Tb7J3yfw7BvhyCS7nsjw+0XNTbpmbBy69EzlATllpHvGt1I7ZH1nFZtXhMU0mdCJl+mT9saFBEo/SFcknKcsz/EhlW1vM+15hBmXU/rYsEUYNBETVnh7PUa0HPcMML+UIxjA2IEzDzoQeZCalEDnCWL9QGhpt69tXgm5oXJgcMKMDfQYTxtogmh+OlISVZyoOWZfMfXxcin/IXMOfFdPsw0omZfKxGAsu8ONs2xPDsmCCvbMGET/jrDe6aJaaUBjujARo5WBdOKQiXRh8nqLtIIFqOAPAZnWETjKixxkmTOKecizDl4C7lJMVEEe0D/cIJrz5OGpJ0uxvSsSxRxWa46yjOvoiogYyywQBAFoWeSQqFauvO+zM1WhpqftSWuYn1AJP0cPbnXGjSYuOCAGz8yPEjqWdsrxtFiMmszPBDm/udFxAB6RtcW4OgSIE2ywRp5vCSGn2qnC9I1oRZ6hXsREEdC2gB28xE2uxQ5LOxIENDz7s1NRwlAh0m66nwkAwl6dIymYFPn6l0MYnqCwWstS1STKExkEjqeuNI55+Nj185eudimSrnzXvucCrN8TSyaBGx037A= 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)(376005)(366007)(1800799015); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?kgiIW7Gt7eFZsLJKJM4/I9rJOK/RD/Wr4KTr172UOz7aScpqRjZTWUSzVsg0?= =?us-ascii?Q?JcEFZkfcNcthjMxLRFYBOJykxeFLBGQsVVChPVEn1/4EHJZsNzqom0mr8UVq?= =?us-ascii?Q?ZYaMRBRE5RZ/usgsOdCLjb54FZHHNaaSB7pEzUgila8GlxxlPaj2hb+fyl1E?= =?us-ascii?Q?rr0uvYoML+nqRxGZXmWk8oBBs4AK8JxJrQujTmaloCQNU6Glii13ERQlQUh3?= =?us-ascii?Q?JkDtIqFxTC/Tnn1C5D2XZZ7yONQ/6filvVdE9pM49RmslycJ+xtc9ObpVvOe?= =?us-ascii?Q?LFM7wjS0Okvc1Eofoz+8HeX0LEYMYnnrePxzN/fC93yi8iXRjQBymzEF0uZ2?= =?us-ascii?Q?tvcodSpxwUi5WVgTtn3AzLPOixP24XdFoZLe4JZRNbKqlZbavlD8obP2Vp+2?= =?us-ascii?Q?FgLxDMFmvm+FOW3RkJlPgcWTEgFPh99TH4unYMvC17qHXcyuO7tIrOzpyDds?= =?us-ascii?Q?IqpJPUY2YsBrEfgOg30mnqRvs7H+vrUZqaNwJb9P9HmxezSjVJM3FL6hyK8t?= =?us-ascii?Q?JvpVnDDT/VATZ3zof/CWHFidtRqTrOVXHAtjVYVDf7kdDxLWXAUrXo+1ZJAg?= =?us-ascii?Q?1rTmGvItJeEpETO40+WgLcroVqTAVg80mEqAzo6Br2E9+lSqVqB5YwlVfch/?= =?us-ascii?Q?YK X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Vz//RG3Uezytx8W8tlskakTXncN8wB38jhFvmXFSqX2vzlD3QBhO6jxNaVEdkXXXs5u4QkJIBdOUFdutyUjrExUfqivM267tcRxJA+vEqnuRKPleYQy91FZ6nbqld1f6zIlyJpa2luoUlX9V2sdhpRuXbc/l6+iGlUyGcAgF0G9R9r9wDKSmJL6XX/mZ8+3h8FMcMKsobbV4QN6D9Q0znlw6ArP+0GxPq7YOqVoPvWYoKvAaFqpF5iZOSMNi2NsJ/2qNCS2gccT5qtnTy1zyat/6KI/XFrlDrRcgHajmIBCxp5WlA1em1cOyB11cuHM11ofCZP1sYe862GhP3s+hspgz+ff/t2q72Ww7eRMAclh5wk1CBVE5QuaDGi/n7F5ZuQKBaur12MJrVFwXUWUo0fvMSvT6yA+6RLEVlINm1NLttd17BP3sV+gwB5o5t907cRRuR+SnJ2Je3x9ShJ9K4CI+22f3ZeXvdZLg4Jl0Pexsnk4Ek9OkfG3g8wueo0qkQa286Uh+zr3eP4+ZTV/toxk36us5lCijgBdAaiJt+q1n4xKexUf4gn0NQHyJJG2PWjSIQBLhW7WPrKHBLaRjVpgvTeXo5YWM0R+t1WNhGco= 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: 0ff24e75-42e3-4134-b59e-08dc5747dbba X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2024 21:15:32.0324 (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: yjyqbHroTDEaMZlTiKllSzcwZNmzUsDl3mOcfEwEjgm/jq9b8je4cdShSGPhNuxEMUTie7bQdyS+IgaPF6WhTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6717 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-07_14,2024-04-05_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 suspectscore=0 spamscore=0 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404070173 X-Proofpoint-GUID: eiKKEQ4iB3HNXX6ku0zCJjacmZTguEqg X-Proofpoint-ORIG-GUID: eiKKEQ4iB3HNXX6ku0zCJjacmZTguEqg Received-SPF: pass client-ip=205.220.177.32; envelope-from=drew.adams@oracle.com; helo=mx0b-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_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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:317595 Archived-At: > The goal is to preview a common prefix > when available and longer than the prefix > already inserted. Related perhaps: https://www.emacswiki.org/emacs/Icicles_-_Expanded-Common-Match_Completion The "expanded common match" described there is the "longest match of your input pattern that is common to all candidates and also contains the first input match in the first or second candidate, whichever is longer". This notion and behavior apply to not only prefix completion but also regexp completion (and substring completion). This kind of common-match expansion is quick but it doesn't always find the longest match. (And of course there can be more than one longest common match.) The expansion typically does find a longest common match, however, because your input typically matches the first or the second candidate in only one place. And the longer the input you type, the more likely this is. In practice, it's only with very short input such as 'a' that expansion sometimes misses a longest common match. The algorithm tries two candidates (1st and 2nd) as its starting point, to increase the probability of finding a longest common match. The expanded common match isn't just a common substring among all of the candidates matched by your input pattern. It's a substring common to all candidates matched by your input, but a substring that also matches your input. For example, with regexp completion input `a.z' and candidates 'abz' and 'apz', there's no expanded common match. The substring 'a' is common to both candidates, but it's not matched by the (complete) input pattern.