From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70217: [PATCH] Add substring-partial-completion style Date: Sun, 26 May 2024 12:11:11 +0300 Message-ID: <86ttilvsy8.fsf@gnu.org> References: <86a5kpgdo7.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23840"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70217@debbugs.gnu.org, monnier@iro.umontreal.ca To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 26 11:12:17 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 1sB9vN-00063L-2n for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 May 2024 11:12:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sB9v1-0001jk-SG; Sun, 26 May 2024 05:11:55 -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 1sB9v0-0001ja-I1 for bug-gnu-emacs@gnu.org; Sun, 26 May 2024 05:11:54 -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 1sB9v0-0003eq-7P for bug-gnu-emacs@gnu.org; Sun, 26 May 2024 05:11:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sB9v8-0003aj-1s for bug-gnu-emacs@gnu.org; Sun, 26 May 2024 05:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 May 2024 09:12: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.171671469013767 (code B ref 70217); Sun, 26 May 2024 09:12:02 +0000 Original-Received: (at 70217) by debbugs.gnu.org; 26 May 2024 09:11:30 +0000 Original-Received: from localhost ([127.0.0.1]:38364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sB9ub-0003Zy-Pk for submit@debbugs.gnu.org; Sun, 26 May 2024 05:11:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sB9uZ-0003Zl-VF for 70217@debbugs.gnu.org; Sun, 26 May 2024 05:11:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sB9uM-0003bi-88; Sun, 26 May 2024 05:11:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=9dFQYcNxp8SbvKCrAGyLrA2dfZyJg9lJ/YJjmKvfrn8=; b=e76TGrmolCtd oGWTun6VZj88OJLwY4wiuSD4iHtfwwYkQBmyNJzymLBG1jEXbW8MeqwZKijFV7fG+bPRRcokMb0mc M2m9GNG3W/oHlpSweVm2EpJEQWXaIIOz5AI02QRQc60eH4iQJmsnP2gxaX7roQoRdcuKNl5wo9qQK LctpO90HgzD9zZo8sn0NUkSB56zowrIAqE9feC/2aWQV68hPi2JCmkdclpPM6CBAnqrG0l3U/9RUI zNlzBwuf8cxKXSqhrd6M/8vPDO2G1bgtDrbRCf6aRqZp8PPPgVv+kz5kfRyNdIkr9BWznUXikx0zv I7HgofB58AgRf0h8/Z/HvQ==; In-Reply-To: (message from Spencer Baugh on Sat, 25 May 2024 17:22:14 -0400) 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:285942 Archived-At: > From: Spencer Baugh > Cc: 70217@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Sat, 25 May 2024 17:22:14 -0400 > > > This is a user option, so the doc string should be understandable by > > users, not just by Lisp programmers who tinker with completion stuff. > > OK, reworded that docstring heavily. Maybe it's better now? See below. > > Also, this new option should be in NEWS, I think. > > Added to NEWS and documentation, and the same for the new possible > values of completion-styles. Thanks. > ++++ > +*** 'completion-styles' now can contain lists of bindings ^ A period is missing there > +An element of 'completion-styles' can be a symbol naming a completion > +style in 'completion-styles-alist'. Now it can also be a list of the This is better rephrased like this: In addition to being a symbol naming a completion style, an element of 'completion-styles' can now be a list of the form... > +form '(style ((variable value) ...))' where style is a symbol naming a We usually up-case the meta-syntactic variables in these cases, so (STYLE ((VARIABLE VALUE) ...) > +completion style. 'variable' will be bound to 'value' (without Up-case "variable" and "value", and don't quote them. > +evaluating it) while the style is executing. This allows duplicating a > +completion style with different values for completion-affecting Not "duplicating" (which sounds negative), but something like "multiple references to the same style". > +An element can also be a list of the form \"(style ((variable value) > +...))\". \"style\" must be a symbol listed in > +`completion-styles-alist', followed by a `let'-style list of > +variable/value pairs. \"variable\" will be bound to \"value\" (without > +evaluating it) while the style is handling completion. This allows > +repeating the same style with different configurations. Here, too, up-case STYLE, VARIABLE, and VALUE, and don't quote them, since they are not literal symbols, they are "placeholders" -- references to something else. > +(defcustom completion-pcm-anchored t > + "If non-nil, PCM matches only against the start of completions. What is a "PCM"? And what are "completions"? I'm guessing you meant something like If non-nil, completion candidates must match at beginning of completed string. > +For example: when the string being completed is \"b/c\", > +\"bbb/ccc\" is a valid completion according to > +partial-completion. If this is nil, then \"aaa/bbb/ccc\" and > +\"aaabbb/ccc\" are also valid completions." Isn't this not the best example? "b/c" does NOT match "bbb/ccc" at the beginning. Or what am I missing? Thanks.