From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74420: 31.0.50; PCM completion for ~/src/emacs/trunk/*/minibuf breaks Date: Tue, 19 Nov 2024 08:18:30 -0500 Message-ID: References: Reply-To: Spencer Baugh Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23322"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74420@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 19 14:19:38 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 1tDO8n-0005tL-F3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Nov 2024 14:19:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDO8Y-0005Lz-Kp; Tue, 19 Nov 2024 08:19:22 -0500 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 1tDO8E-0005Kw-R7 for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 08:19:02 -0500 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 1tDO8E-0004KJ-30 for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 08:19:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=kocQqqCf6Rgl+xrV6Ja3bB1tlBtUD4mvaPehLoZm34Q=; b=WLWO1e8FfEtLkIuI6Kl6mvFe04Xofxm89yhnGK1pvq5ysfMWKRxpBv3efILZeiJkCTpek/Jqsoc95xaem8XEQK+DpmO9KG8SWW4NE83vu7AlMGkjHrjn8RNSlrVt9QnDp8meXHQ8oyObWh2rQB5llnqjP2z+65ftDWO/5toEMHAZ55PO6j0po8D39D8oG2GD3HwoijOiO6Xq5F+0mdGfWpIdJw/RtFL7WDCZo9VQ+uMbYdN2GQh9AEOWpJtCbSNAXoLKvL/YhRrfX2HBXQVrezkl1pEWtvmLLdROPhiR2hSUcu68y6reP/HhXG8t4UhwsGVO0z6X1XFLR8i0fR8Wsg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tDO8D-0005QL-Tc for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 08:19:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Nov 2024 13:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74420 X-GNU-PR-Package: emacs Original-Received: via spool by 74420-submit@debbugs.gnu.org id=B74420.173202231820820 (code B ref 74420); Tue, 19 Nov 2024 13:19:01 +0000 Original-Received: (at 74420) by debbugs.gnu.org; 19 Nov 2024 13:18:38 +0000 Original-Received: from localhost ([127.0.0.1]:41479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDO7q-0005Pk-54 for submit@debbugs.gnu.org; Tue, 19 Nov 2024 08:18:38 -0500 Original-Received: from mxout6.mail.janestreet.com ([64.215.233.21]:43117) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDO7o-0005PS-3C for 74420@debbugs.gnu.org; Tue, 19 Nov 2024 08:18:37 -0500 In-Reply-To: (Stefan Monnier's message of "Mon, 18 Nov 2024 18:58:47 -0500") DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1732022310; bh=kocQqqCf6Rgl+xrV6Ja3bB1tlBtUD4mvaPehLoZm34Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=AFOVWkbxv54+livL88LYk3juoEbI2iQcjEAcxW910UitMLOUQKAU5bjA+gxDN3rqi ZLZXIQIMREpIOAKaxof6iez6cTuIBTwcxb+2psgZ0VNQE85EiE2nm+nnsGcyupPU44 6J/2ejbbGtCcfh4P1o9ExWOog9j6cwZT2qOIxjUaU6OLL0zdjhkYWoFffp5quXmFh9 QMUhDvfbuBurcaQiYE+WaVFuD+vHPH/BeKmKw1GZZIJ9J8lpS/mw2H+yrPsWSdIBKn 8pGjBkMC7adiQjfS0+fdtx/21Q33y7hUL1U6/VJTU3lKn/BrmzU+JR4TUoa5Igxo7V xXKXqr8FN9rVg== 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:295633 Archived-At: Stefan Monnier writes: >> Actually... I just realized this misses some cases, namely when we have >> "star point" or "point star". > > FWIW, my local patches have included for years optimizations like the > ones you suggested *and* they replaced `star point` and `point star` > with just `star`. > > Do you think it's important to preserve `point` in those cases? Hm, I'm not sure. I've been playing around with alternative ways to move point in pcm-try-completion but haven't yet got something I'm satisfied with. So let me defer this question until I've hacked on that some more :) >>> BTW, maybe we should go with something like >>> >>> (`(,(and (pred symbolp) s1) ,(and (pred symbolp) s2) . ,rest) >>> (cond ((completion-pcm---p s1 s2) (setq p (cons s1 r= est))) >>> ((completion-pcm---p s2 s1) (setq p (cons s2 r= est))) >>> (t (push (pop p) n)))) >>> >>> Where `completion-pcm---p` is some kind of partial ordering? >> >> Interesting thought. Maybe it would make sense to have something like >> - completion-pcm--wildcard-grows-on-left-p >> (non-nil for star, point, any, any-delim) >> - completion-pcm--wildcard-grows-on-right-p >> (non-nil for star, point, prefix) >> - completion-pcm--wildcard-in-text-p >> (non-nil for star and point) >> Then this case would be something like "if grows-left/right-p is the >> same, and at most one of the symbols is in-text-p, delete the >> non-in-text-p one". > > But I guess your `completion-pcm--merge-completions` is still needed as > long as we can't optimize all sequences of symbols to a single symbol. > =F0=9F=99=81 Yep. And here's one case that I think makes optimizing all sequences down to a single symbol impossible: (star star star) is reified as ***, not shrunk down to a single *. I think that behavior is probably reasonable (or at least I'm not in any rush to get rid of it), but to preserve it we have to preserve sequences of multiple symbols.