[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#68815: Unexpected behavior with read-file-name and functional REQUIR
From: |
Joseph Turner |
Subject: |
bug#68815: Unexpected behavior with read-file-name and functional REQUIRE-MATCH argument |
Date: |
Wed, 31 Jan 2024 11:33:31 -0800 |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> They should wrap PRED so as to pass the arg through
>>> `substitute-in-file-name` (or otherwise arrange to make sure PRED is
>>> called with an unquoted file name).
>> Thank you for the clear instructions! Does the attached patch do the
>> right thing?
>
> I theory, I think it's correct, yes.
>
> Whether the rest of the code handles it correctly OTOH is a different
> question. E.g. I have the impression that currently the
> `read-file-name-internal` completion table presumes the PRED argument
> takes an already-unquoted file name.
What other code would this patch affect?
I see that `completion--file-name-table' uses `substitute-in-file-name',
but I don't understand how this patch would affect completion table.
> Also, performance can be a concern (in many cases it makes more sense
> to make the caller pass the unquoted name rather than force it to quote
> the name only for PRED to unquote it).
The REQUIRE-MATCH function is only called once when the user attempts to
exit the minibuffer. Would you please explain the performance concern?
Thank you!
Joseph