GNU bug report logs - #74208
31.0.50; minibuffer read-file-name-default mutates global value of default-directory incorrectly

Previous Next

Package: emacs;

Reported by: Madhu <enometh <at> meer.net>

Date: Tue, 5 Nov 2024 02:10:01 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Madhu <enometh <at> meer.net>
Cc: eliz <at> gnu.org, 74208 <at> debbugs.gnu.org
Subject: Re: bug#74208: 31.0.50; minibuffer read-file-name-default mutates
 global value of default-directory incorrectly
Date: Sun, 10 Nov 2024 11:54:36 -0500
> for the example in the thread,
> ffap.el:(ffap-read-file-or-url) calls read-file-name-default, via
>               (funcall #'read-file-name-default prompt guess guess) =>
>
>   read-file-name-default("Find file or URL: " "http://example.com" "http://example.com")
>
> (read-file-name-default PROMPT &optional DIR DEFAULT-FILENAME
>  MUSTMATCH INITIAL PREDICATE)
>
> The problem is that the parameter DIR == "http://example.com" was
> getting bound to default-directory with undesirable results.

It can also have desirable results sometimes (depends on the URL at point
and what kind of support for URLs you have in your Emacs, admittedly).
Do you happen to have a more realistic scenario than your "echo foo"
that lets us better judge the severity of the problem, and maybe other
ways to solve the actual problem?


        Stefan





This bug report was last modified 159 days ago.

Previous Next


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