From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Recommendation for CAPF setup when you don't know completion string in advance Date: Tue, 11 May 2021 12:54:03 -0400 Message-ID: References: <488b4688-239f-4915-a1fa-a1c3764234d1@mendler.net> <091ea98f-bba5-60ce-e8e1-33c6d4eb6ac0@daniel-mendler.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23719"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: JD Smith , emacs-devel@gnu.org To: Daniel Mendler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 11 18:57:25 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 1lgVhE-00065d-Oc for ged-emacs-devel@m.gmane-mx.org; Tue, 11 May 2021 18:57:24 +0200 Original-Received: from localhost ([::1]:39638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgVhD-0005Oj-QQ for ged-emacs-devel@m.gmane-mx.org; Tue, 11 May 2021 12:57:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgVeA-0007eb-9k for emacs-devel@gnu.org; Tue, 11 May 2021 12:54:14 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60464) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgVe3-00041D-H2 for emacs-devel@gnu.org; Tue, 11 May 2021 12:54:13 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C9EDC8088B; Tue, 11 May 2021 12:54:05 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3700F8026B; Tue, 11 May 2021 12:54:04 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1620752044; bh=WDKpXt/V3K7YVGKrmxJfF3SMW2c9LGT3EOiDYIQ97pw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=fqlVPtjNaUW5V0FTxyCRRSIjXU1SacZWE7E9OkjriltdZzQzKsCr8IqdhqDsO8KAk w/2nYzkZWGNNutJ5H39silwLZzZC/H65OXMbqdKOGf2USmYXOkfZVknEqI+8uZUkJi TVaK1pCJLLCHx6PNReJHZiLGSQ2GgT+uAQ6va0B2uE1Uv/56X6ZKXhzZM/qgyuQS3B 0AJhWGFGF9AZ0CcW9vK3mc/2kJCIWO2Yh1lQnJK49Jcf/RfkdDjBO/598x4CIzIDzc +0BhlZLvxbB717IKxiNDfFr/K6mkpTkgPBHzk0Tw4WIeh/W0QyLEWyjKREaRqS7lEC UX4OQD+YMIf3A== Original-Received: from alfajor (76-10-140-76.dsl.teksavvy.com [76.10.140.76]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0506F120921; Tue, 11 May 2021 12:54:03 -0400 (EDT) In-Reply-To: <091ea98f-bba5-60ce-e8e1-33c6d4eb6ac0@daniel-mendler.de> (Daniel Mendler's message of "Tue, 11 May 2021 18:10:12 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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.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:269169 Archived-At: >> I think the answer depends on the completion-style. IIRC some >> completion styles do that on purpose (in order to preserve/reproduce >> the behavior of earlier completion code), whereas I seem to remember >> a few cases where we may do something like that not on purpose (rather >> because of a bug, or out of laziness). > > I see. There is some code in `choose-completion-string` which checks if > the length of the resulting string equals the car of the > `completion-boundaries`. When choosing a directory, the minibuffer is > not automatically exited. But the suffix string after the directory is > still thrown away. I don't see where the completion style is involved here. Sounds like a bug then. > The problem is probably that when appending the suffix the resulting > choice is not necessarily a valid candidate. This is at least how I > thought about it when replicating the behavior in Vertico/Corfu. Something like that, yes. > We could adjust the `choose-completion` behavior such that the suffix is > never thrown away and completion is never automatically exited when a > suffix exists. Would that make sense or did I miss something? I think it makes sense. > Is this worth a bug report/patch? Yes. Stefan