unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Mendler <mail@daniel-mendler.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 47678@debbugs.gnu.org
Subject: bug#47678: 27.1; `completion-boundaries` assertion failure for file
Date: Tue, 13 Apr 2021 16:44:42 +0200	[thread overview]
Message-ID: <c62c028e-ccce-7b4a-f6c0-40aa48af1ad8@daniel-mendler.de> (raw)
In-Reply-To: <jwv4kga5pjm.fsf-monnier+emacs@gnu.org>

On 4/13/21 2:46 PM, Stefan Monnier wrote:
> 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).

I am aware of that feature and use it but for now I avoided looking into 
how this is exactly implemented :)

> 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.

Thank you for the detailed explanation.

Ok, but in the case where this issue occurs we already have a somehow 
broken path, especially when moving with the point over the shadowed 
parts. So as a user I would not be worried to much if this does not work.

I hope most assumptions down the line are checked by conditions. However 
given that in this particular case we already have an error we could 
only get more errors at worst down the line?

(Btw, in Vertico I throw out the shadowed paths as soon as I get the 
opportunity (vertico--tidy-shadowed-file) in the same way as Icomplete 
does it if enabled.)

Daniel





  reply	other threads:[~2021-04-13 14:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 20:35 bug#47678: 27.1; `completion-boundaries` assertion failure for file Daniel Mendler
2021-04-12 23:28 ` Stefan Monnier
2021-04-13  4:04   ` Daniel Mendler
2021-04-13 12:46     ` Stefan Monnier
2021-04-13 14:44       ` Daniel Mendler [this message]
2021-04-13 22:34         ` Stefan Monnier
2021-05-06 10:01           ` Lars Ingebrigtsen
2021-05-06 11:07             ` Daniel Mendler
2021-05-07 11:14               ` Lars Ingebrigtsen
2021-05-08 23:41               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-09  8:34                 ` Daniel Mendler
2021-05-09 13:37                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c62c028e-ccce-7b4a-f6c0-40aa48af1ad8@daniel-mendler.de \
    --to=mail@daniel-mendler.de \
    --cc=47678@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).