From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70217: [PATCH] Add substring-partial-completion style Date: Fri, 5 Apr 2024 19:46:07 +0000 Message-ID: References: Reply-To: Drew Adams 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="2322"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "70217@debbugs.gnu.org" <70217@debbugs.gnu.org> To: Stefan Monnier , Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 05 21:47:28 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rspX6-0000In-37 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Apr 2024 21:47:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rspWf-0003IB-CO; Fri, 05 Apr 2024 15:47:01 -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 1rspWb-0003Ha-Pf for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 15:46:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rspWb-0000aH-9g for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 15:46:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rspWg-0002UQ-G2 for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 15:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Apr 2024 19:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70217 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70217-submit@debbugs.gnu.org id=B70217.17123463849433 (code B ref 70217); Fri, 05 Apr 2024 19:47:02 +0000 Original-Received: (at 70217) by debbugs.gnu.org; 5 Apr 2024 19:46:24 +0000 Original-Received: from localhost ([127.0.0.1]:37528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rspW4-0002S4-6t for submit@debbugs.gnu.org; Fri, 05 Apr 2024 15:46:24 -0400 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:27540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rspVz-0002RQ-3g for 70217@debbugs.gnu.org; Fri, 05 Apr 2024 15:46:23 -0400 Original-Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 435Jg93K003200; Fri, 5 Apr 2024 19:46:12 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=yKLSl+7GUGIF93zV5I5Y0zByuOtF3u7KVz31XLq2HvQ=; b=c4zxq+wIhZYHQ+Lhjl5Ybfd4GXEHhCdCUrawzZ6Hg0d6dkEGOfQdJNHL9yQ9xDuQ3uLr wQg1FUt3rBfFQ9u0f8PUGfPNlDwa9ubPB70DNKCnNah97jwivZ83EBH9CmBdL/Tmq8Zm O8Y4fYry+MZZwHtTZ32ebOKpPC/vtZuoTtZNtM5foRvTi/tRMUkNMSNlzwtyRgm0G6B9 CxIRXWRExLK44klpoJqcK0w6LXsJ1iclG/tU2aEdNlGYFS3Widmma/Q+megq4WBsEvzb esbDihdjeQg3LHBJ2YV4jCcEOt0DoYP9FtBwueA2VEciJ+idAS2wPI8dwPL1UOXJfo4n UQ== 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 3x9evyv92v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 05 Apr 2024 19:46:11 +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 435HpNQT009372; Fri, 5 Apr 2024 19:46:10 GMT Original-Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3x9emngwf4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 05 Apr 2024 19:46:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nIlbe7loojfZ9YSqPscZVhSymvu7Kw08bH4TbIkpzXBGnYCcdCITCZCVkm2kfInJDNgA+na3NlBoRrGrn+D3QB/pJjefoQtrzSsyGR4oWAY2RTHiADZhWr61E5ggVP42VGQJbzg0ks+WoDoQJNN4huDiEOpontJHq4Pgwc0kQv079lrskUaqXSMMALNUV+RozYdjrxZi1cz98GDKgExwq1deUTs3t0497uHoAj0teT0jP7F08/rdGxFDAPyfLwZwM96uu3vwxwLc3ymsa6GzBurbewmcfAMiiX2VcSBlo0pc6djXknr6dus/i/NaBnzXCcdKssVeAmW+sdIhSSFYrA== 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=yKLSl+7GUGIF93zV5I5Y0zByuOtF3u7KVz31XLq2HvQ=; b=AfQSZ1bBBYebV9DyVDnEw35fKOjzhu7ku8rV3g4IFuNFNyo1QgKMLSXx24VA9eTZFkTOjWVq/Pzp0sBc9Obtf3Wns/fxjt0DiecmEPUzjBhHNTjALXogzUWuqhIzOhtzriZxPmh0Pkk426uQbeDy4w4K1rY22x2nlgJJnmUVqcKQ7uOKqOwofo/ObksIwHDzdgQ70wSJDOOIOqlsPHQPXdbScb/D1Uc7Mzouv6T8DgkNFpSz2Z0mWSXk71WbzweMMVRrVzIsHdGZ0IIYKBirwLtDsKUZmZ0JeQHi9bz6Rbn9OSf9Nik+tP4lhuL96Yu1ktaPSz30V6WkvlFj5AU5Ag== 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=yKLSl+7GUGIF93zV5I5Y0zByuOtF3u7KVz31XLq2HvQ=; b=lEYD0Q3yJuZDnAqSDitOVuFZPP76QZ9vEpQjhDqNKw+qTRl/yDSnEayK67ZAFLfHWHs23apwRSySzNCkzbkdzX2R6VrcPpjERaTOemA/oGWYu2Zuf8soZGV+spyegTfwvON8P0IYN4EceQ3HSrWqAueHnZT6aSeibwg8GFU/9iw= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by IA1PR10MB7540.namprd10.prod.outlook.com (2603:10b6:208:445::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.26; Fri, 5 Apr 2024 19:46:07 +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; Fri, 5 Apr 2024 19:46:07 +0000 Thread-Topic: [External] : bug#70217: [PATCH] Add substring-partial-completion style Thread-Index: AQHah4iYpniH+TW1VkO8KQCcYr9oT7FaCikA In-Reply-To: Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|IA1PR10MB7540:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ivt3JxhMfoumSUR7XaZaG1I95QC4E4zrVSS2ziplHZDGNI0zhJaZ9ub5Ikb99qN90/giHjcLFL3G3ADCn2uFnJxTyFlydVzyaIqaBZCSM4HoB8qAei6LdzjLz9LcBF8AHhscKz2FZDuXvoqyecGjlkzONGZ8Bf+AP9Bb1b6AiDjrF4rIQkwBIJw4Kc09d4jJA0M6A231Sci1h2Z/QddNZ/J0u7AEsTUa1HggizOd6lz6ANVP58fmhwf/80CHsTsQwOf24Y2Dd7SWdkHfUqqcfmhCR/qKCDihHY8OfUOvb5uZwmmFudkEOihRNaPvvbwThvGboAISyKFKFK5gFealW0wVRAdPLZ9pU8l8HFDOJcUegDBYQ4+Gq9jPAhwcrmgO/+XEVdRD34YgyZWhmNg8zlX2NJhWO/CSBK9gt8aVjUwGH92kU3iyaiR41f5TKiCSqNY1htHG7OnRpeHIDbGnMR/LVuacPND8eWN9mE6Jx6m4ZrqZmgYFyfCMNg4bddequvP+NcfL3wIKPsilDNdtss+nOHe/8jOI9jDGxjH1MiHpuS5xJJpkIzvLSNr8CPoc/d91UsfK6osLGeW0KIKeC4ywMZjQu/VLj2lasli6wN8= 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)(366007)(376005)(1800799015); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: RqqRqFN6cJxxTsElKIpIjo1MeEC41XtF+FuCwYwEsSBXUWlFyzGnCzkUK+DpzniCV8zoqc9kJCZYKS7YukTAHdWLvs3azR/fctte0LPsf4Gr5HKMhW/ZDJzFPjh9b1++0PGObinLg71gjYhdrL8rpecXGFP2fHDG7ZHYcqVhGB+6LiL4WRfMMecV/cb0Z6iuzBIhU5TgynCdTsc/dWmnGQAJwU05O3vS+aECgvVLD25hSNKt+dz2v9cGcIrW5+imtsip6KQtiloYg5LeOehKj8CdXb+udtuMF2JGuzQV/3QNaS9P2EqnS+zbhxdztjZo3l6uupNJLGXUOud/R89NM+qnn+FPeVfRxek1Yue5iIdLQik1CJbWKyK7ORp+iGehud9FxDJ8JNHJhYTLhJOxXY0wekt3krYf8eaR09RhmSvuaYwEBrcUsCcx3wR80BokcyPfu5QXXy0j75x5oLT50R71UYGK5MISRmuzaZnM/f50N0VCIKG1dDZ18nqs8p9yRwK/qcdJ97jdyOsImw4aZTOqg4KM9sqS53i9CDL8VllPhubzbSyJC2P6MrYyq7s8MnlX164n7nKuxdlvovQWsgFjtBHB3mJLR60DGnaBlbfbdJ1Qlb07PWjpqP4KSF3vjIWviHmp1uCFNYEHZOvHbhqRkLRMNOLu8K4W21FhLzmmOF1bbU6oJdbMsTL32794Itcvj8Z1adlOucLffr4wSCohtRgVh0+UaPid/TjgI149xELXZC5BX8uhy7 R/ZMHFe0kLbXP8hyyaoT7nUcUQGrIZ5MEMf1WQ5tNHUS0DXlUxqqp4A+4TKid6HfRuYKa1YSR0htMUcRV46tlMbJCzcgO29cFR X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: SawFjOGUJTwYcv4199ul5rE1TZRjI1qUso++I3cDCqCXDNpH7jkztheh7UxsxL7gSLLP9zJAgGy7FYBhEg139FPpkOKm4HB70plhNMn8ZpIWJyktrkGI7qH6haIVJUZSJGGmLq/fo7BwwCq1qHgDf4jrxJSZDZwaYflyQUD6KQ9Y4yNr3AoJrGP+08JI3wbnwN/F4PbAC4i+uKZaHB/Fmcvo//ScSnfyiEXBfB/L+Zg+tZlolSF9Dfl6O6t1B1NeEFYPhpWRhADt1ZpL5gUtk+qIrQszRoeS9sn5mvnQA2IuCD2sgjjbmWGOIYmHsFwnJahHAfI5/GGgrdauBYchA0k0O7iIZrsEtpjbx9WWlEpTrM+baLEIRJHsF2WI916GpUxYPFmRwzlZM16ZyEn04E2m68SW3+FChKVlinwK5qTHW/C2B6vKRlNj5Ljl9cK29xzDVi2UxUFhxaJ6z3rmI8nHumjmB5TgSryCchD+EVv1b694VhnBIqE/XHObW3Eue1ZCPSpqlTJP6pAhrEVQMrMIagd2HjmSsJqam792pDxs+Gkm5lEnk6ObuevU47FnTw7TFWH7rjXRSK1QR/zS/4QzZousEElRhhdk4E9WsOQ= 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: d87b7e8b-ffd9-4888-519b-08dc55a90970 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Apr 2024 19:46:07.5624 (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: 7ZAcdEqt+uPlvjEsNrZVks7bKVlr6bL6LdTdjOcDYZaG68FKUa6KBQj2x3upkqK6v5Gxr7O7TiuzGNXlN5Gqsw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7540 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-05_23,2024-04-05_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 suspectscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404050140 X-Proofpoint-GUID: i29Er5LjQheERJJR0oQ_1NdEmCAD7lxO X-Proofpoint-ORIG-GUID: i29Er5LjQheERJJR0oQ_1NdEmCAD7lxO X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282721 Archived-At: > > It's preferable for this to be a separate style from partial-completion > > rather than a customization for partial-completion, because completing > > with a leading glob is inefficient: it doesn't allow the completion > > table to do any filtering at all. So, for example, one might want the > > regular partial-completion style to run first, and if it doesn't find > > anything then the substring-partial-completion style can run. >=20 > FWIW, I think the "language of completion styles" > would benefit from being a bit richer. FWIW, I agree. Richer in different ways/dimensions. > I.e. instead of a completion style (i.e. an entry > in `completion-styles`) being limited to a symbol, > we could extend it so a style can take arguments. >=20 > E.g. the `substring` style could take an argument > which when set to the symbol `pcm` would cause it > to behave like your "substring-partial-completion": > (setq completion-styles '(basic (substring pcm) emacs22)) >=20 > Alternatively, it could be an argument to `partial-completion`, e.g.: > (setq completion-styles '(basic (partial-completion notanchored) emacs22)= ) I'm not sure that's the best way/place to provide for that, but yes, it's one possible direction for enrichment. ___ FWIW, I think `completion-styles' is too rudimentary in additional ways. (I've mentioned this before.) 1. There's only one set of completion styles that's ever in effect. Each style is tried, in turn, until one of them successfully completes your input. They can only be used together - all or none; they can never serve as alternatives that you can choose interactively (runtime). 2. All completions you see come from the same style. You have no control over which style will actually be used for any given input, other than ordering the styles ahead of time. And you have no way of knowing which style was actually used to produce a given set of candidates. For users, the link (cognitive and otherwise) is lost between a style and its completions for a given input pattern. The relation between your input pattern and the matches is thus sometimes not so clear. There's no way to know, e.g., that initial matching failed and partial matching succeeded. 3. Instead of a single list of styles, Emacs should support a set (list) of such lists, which you can choose from at runtime. You can try completing using one styles list and, if that doesn't succeed, switch to another.=20 Since any such set can be a singleton, allowing multiple sets also means you can use just a single style. 4. Users should be able to define, for a specific _command_, the possible styles sets to choose from, and do so interactively. ___ I'd say Emacs should think about providing more=20 flexibility for what kinds of completing (and sequences of such kinds, per `completing-styles') are available and how users and code can move among them or conditionalize them per context. ___ As an illustration, Icicles has long had such=20 possibilities (even before `completion-styles'). https://www.emacswiki.org/emacs/Icicles_-_Completion_Methods_and_Styles