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.bugs Subject: bug#47678: 27.1; `completion-boundaries` assertion failure for file Date: Tue, 13 Apr 2021 08:46:22 -0400 Message-ID: References: <8d537117-d036-ad84-e013-d98efb3ae0c4@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="32309"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 47678@debbugs.gnu.org To: Daniel Mendler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 13 14:47:13 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 1lWIRk-0008FY-2F for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Apr 2021 14:47:12 +0200 Original-Received: from localhost ([::1]:44976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWIRj-0001DH-0L for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Apr 2021 08:47:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWIRb-0001D5-0f for bug-gnu-emacs@gnu.org; Tue, 13 Apr 2021 08:47:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47712) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWIRa-00019k-Q2 for bug-gnu-emacs@gnu.org; Tue, 13 Apr 2021 08:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lWIRa-0003Cz-OE for bug-gnu-emacs@gnu.org; Tue, 13 Apr 2021 08:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Apr 2021 12:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47678 X-GNU-PR-Package: emacs Original-Received: via spool by 47678-submit@debbugs.gnu.org id=B47678.161831799312275 (code B ref 47678); Tue, 13 Apr 2021 12:47:02 +0000 Original-Received: (at 47678) by debbugs.gnu.org; 13 Apr 2021 12:46:33 +0000 Original-Received: from localhost ([127.0.0.1]:59254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWIR7-0003Bq-2m for submit@debbugs.gnu.org; Tue, 13 Apr 2021 08:46:33 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:34985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWIR5-0003Bc-Nf for 47678@debbugs.gnu.org; Tue, 13 Apr 2021 08:46:32 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 30F8E10001F; Tue, 13 Apr 2021 08:46:26 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B0BBA100205; Tue, 13 Apr 2021 08:46:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1618317983; bh=S8qGulzPwoz2KswQAhUlkj6FdzKQr5fgR7aFj5VXSUg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=G4E4s64wOTGyEC1CKVS4Ie4DIZGiLODYs1mVJ7UxDjmDoIfRLRL/pWoaMzlHvxh57 RKe0K+zUGmEsy5jgEQ9wS1Jlu2FiOMfErSA2xTnAlio81GCpBuYSOfn2slJ8rYyh/7 R1JgIpfWvcv/9m8a77K1BGpz2GxViZm/9v0L0/a8288kWhPyw4r2CfKX6QdvkhgM4m 4QgYVmqF5RaP0THtZncYCL2bUxN0d/2X6U7G6FummLnp1UWIuNGyBUZRX8K9mkkpu1 SBzwevZYO11SBiVt/ckvDl4Ow9PCOI8l6RMMW89SzvC1smDsmR3fnmyoOehnhMNqb9 Nd2jtoEImqBuw== Original-Received: from alfajor (104-222-126-84.cpe.teksavvy.com [104.222.126.84]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8101F1201A7; Tue, 13 Apr 2021 08:46:23 -0400 (EDT) In-Reply-To: (Daniel Mendler's message of "Tue, 13 Apr 2021 06:04:24 +0200") 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:203962 Archived-At: > Thank you for looking into this. I hope this will not lead to further > problems, it is mostly an edge case when moving around the cursor and the > path at that point is not really valid? What kind of issues could happen? > I can always enter some invalid/shadowed path ///, /~~~/, ~/~/~, which do > not make problems (at least with this patch). The problem has to do with quoting/unquoting: in `C-x C-f` we do not quite enter "raw file name" because the name typed by the user is passed through `substitute-in-file-name` which expands envvar references (and de-doubles dollars for those files whose name looks like an envvar reference) and does some truncation (like foo//bar => /bar). So the `completion-file-name-table` (which completes raw file names) is wrapped via `completion-table-with-quoting` and this function has to be able to relate the unquoted text back to the quoted text, for example in order to convert the boundaries returned by `completion-file-name-table` (on the unquoted file name) into the corresponding boundaries that apply to the quoted file name. This is in general somewhere between hard and impossible. So if/when we get those boundaries wrong (for example) it may lead to misbehavior down the line. I'd rather not try and guess what those might be. I'm just hoping that they're minor enough and rare enough. Stefan