GNU bug report logs - #68815
Unexpected behavior with read-file-name and functional REQUIRE-MATCH argument

Previous Next

Package: emacs;

Reported by: Joseph Turner <joseph <at> breatheoutbreathe.in>

Date: Tue, 30 Jan 2024 09:32:01 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 68815 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Joseph Turner <joseph <at> breatheoutbreathe.in>
Cc: michael_heerdegen <at> web.de, Philip Kaludercic <philipk <at> posteo.net>,
 68815 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#68815: Unexpected behavior with read-file-name and
 functional REQUIRE-MATCH argument
Date: Wed, 31 Jan 2024 08:28:01 -0500
>> 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.

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

IOW, I think we have a bit of a mess in our hands (that's what I was
meant by "good old problem" 🙁).

> If so, may it be applied to emacs-29?

Definitely not material for `emacs-29` I'm afraid.


        Stefan





This bug report was last modified 1 year and 183 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.