From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler Newsgroups: gmane.emacs.bugs Subject: bug#47678: 27.1; `completion-boundaries` assertion failure for file Date: Sun, 9 May 2021 10:34:52 +0200 Message-ID: <8102d308-0c23-f3ac-93c2-1634abe24acc@daniel-mendler.de> References: <8d537117-d036-ad84-e013-d98efb3ae0c4@daniel-mendler.de> <87v97wxjtf.fsf@gnus.org> <214d78e9-cda2-e2f2-7284-0f4f6bda43b7@daniel-mendler.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15248"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47678@debbugs.gnu.org, Lars Ingebrigtsen To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 09 10:36:19 2021 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 1lfevC-0003tj-Mo for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 May 2021 10:36:18 +0200 Original-Received: from localhost ([::1]:39380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfevB-00054A-Mk for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 May 2021 04:36:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfeuw-00053p-Mh for bug-gnu-emacs@gnu.org; Sun, 09 May 2021 04:36:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lfeuw-0005VO-FC for bug-gnu-emacs@gnu.org; Sun, 09 May 2021 04:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lfeuw-0002FK-BQ for bug-gnu-emacs@gnu.org; Sun, 09 May 2021 04:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 May 2021 08:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47678 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo fixed Original-Received: via spool by 47678-submit@debbugs.gnu.org id=B47678.16205493048608 (code B ref 47678); Sun, 09 May 2021 08:36:02 +0000 Original-Received: (at 47678) by debbugs.gnu.org; 9 May 2021 08:35:04 +0000 Original-Received: from localhost ([127.0.0.1]:55052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfetz-0002Em-NY for submit@debbugs.gnu.org; Sun, 09 May 2021 04:35:03 -0400 Original-Received: from server.qxqx.de ([178.63.65.180]:41359 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfetx-0002EK-2S for 47678@debbugs.gnu.org; Sun, 09 May 2021 04:35:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=bYGwAPAiZWyeRMu5PSm6jgnjTa+3aRWQ4Q+dhiOU72s=; b=OxCxzmi8GkgMgR3/fs/0hzyr7P Rono85euowZcn98rZb6RNDcghI9lgNozkKQ1UEFzeFDqc3V5dZZcB1uLb7hE7+JvGiyGILwiFlTvP kJ9i3xwdgz8OvRFrKUnOf/dugqVP4OTpzUI2LdzAOxf6MbPt0dMBl9xXZEsObkoyOTio=; In-Reply-To: Content-Language: en-US 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" Xref: news.gmane.io gmane.emacs.bugs:206050 Archived-At: On 5/9/21 1:41 AM, Stefan Monnier wrote: > Not only the way it's done is inevitably "hackish", but it's also very > hard to make it correct. E.g. the shadowing is not a property of > file names but of `substitute-in-file-name`, so `file-name-shadow-mode` > and `vertico--tidy-shadowed-file` can misfire if you're reading a file > name which will not be passed to `substitute-in-file-name`. > ... > To do it right, we'd need completion tables to provide some kind of > "tidy up" or "simplify" or "canonicalize" method, I think. Thank you for the clarification. I agree. A while ago when fiddling with file based commands I had wondered why completing-read or the UI can even return shadowed paths leading to complications down the road. A canonicalize method would be a good way to achieve this generically. Are there more examples where one would want to do such a canonicalization? In the case of file name canonicalization, one has to consider - the file name is allowed to contain environment variables. This is a feature which I would like to retain at the UI level. It would be good if the returned string is canonicalized, but I do not want to dynamically expand the environment variable while the user enters input. In contrast, with shadowed paths I am perfectly fine if the UI removes that shadowed path automatically, like Icomplete and Vertico do it. What do you mean by "providing a method"? Add a method to the completion table function itself or to add a completion metadata `canonicalize-function`? Modifying the completion table specification itself is more problematic since it is not extensible in its current form. Daniel