all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Joseph Turner <joseph@breatheoutbreathe.in>
Cc: michael_heerdegen@web.de, Philip Kaludercic <philipk@posteo.net>,
	68815@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: bug#68815: Unexpected behavior with read-file-name and functional REQUIRE-MATCH argument
Date: Tue, 30 Jan 2024 08:08:11 -0500	[thread overview]
Message-ID: <jwvfryfas70.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <8734ufyxoy.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Tue, 30 Jan 2024 01:00:47 -0800")

> emacs -Q on the tip of the emacs-29 branch (after commit 77f5d4d523a), run...
>
> (let ((default-directory "~/"))
>   (read-directory-name "Clone into new or empty directory: " nil nil
>                        (lambda (dir) (or (not (file-exists-p dir))
>                                     (directory-empty-p dir)))))
>
> ...then type "/tmp/" (the whole minibuffer now reads "~//tmp") then RET.
>
> Expected: Completion does not exit, instead saying "[No match]".

Ah, that good old problem about whether PRED should apply to the quoted
or to the unquoted string 🙁

I think here the bug is in `read-directory-name` (and `read-file-name`)
since their PRED arg is expected to apply to the (unquoted) file name
itself (i.e. the thing that would be returned by the function), rather
than to the quoted representation used in the minibuffer.

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


        Stefan






  reply	other threads:[~2024-01-30 13:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30  9:00 bug#68815: Unexpected behavior with read-file-name and functional REQUIRE-MATCH argument Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-30 13:08 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-01-31  6:11   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-31 13:28     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-31 19:33       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-31 22:05         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-31 22:34           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-06 21:08             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-31 22:44           ` Stefan Kangas
2024-02-01  6:59           ` Eli Zaretskii
2024-02-01  7:04             ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-01  7:39               ` Stefan Kangas
2024-02-01  7:59               ` Eli Zaretskii
2024-02-01 22:26                 ` Joseph Turner 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

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

  git send-email \
    --in-reply-to=jwvfryfas70.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=68815@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=joseph@breatheoutbreathe.in \
    --cc=michael_heerdegen@web.de \
    --cc=monnier@iro.umontreal.ca \
    --cc=philipk@posteo.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.