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


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Madhu <enometh <at> meer.net>
Cc: 74208 <at> debbugs.gnu.org
Subject: bug#74208: 31.0.50; minibuffer read-file-name-default mutates global value of default-directory incorrectly
Date: Sun, 08 Dec 2024 12:33:13 +0100
[Message part 1 (text/plain, inline)]
Madhu <enometh <at> meer.net> writes:

Hi Madhu,

> Thanks, something like the attached? the implementation of "turn on
> url-handler-mode temporarily" looks a bit gross but i guess it can't
> be avoided.  should call to turn it on be outside the
> minibuffer-setup-hook?

Perhaps, I haven't tested. However, the leading comment doesn't match
anymore the implementation (default-directory is let-bound now); better
you'll adjust it.

I've checked the problem in ffap.el. It looks like we could use a much
simpler solution: implement unhandled-file-name-directory in
ffap--url-file-handler. Something like

[Message part 2 (text/x-patch, inline)]
diff --git a/lisp/ffap.el b/lisp/ffap.el
index 6a4915fb5a3..b03e625c123 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1512,6 +1512,7 @@ ffap--url-file-handler
       ;; We mainly just want to disable these bits:
       (substitute-in-file-name (car args))
       (expand-file-name (car args))
+      (unhandled-file-name-directory nil)
       (otherwise
        (apply operation args)))))

[Message part 3 (text/plain, inline)]
Does this solve your problem?

> --Regards, Madhu

Best regards, Michael.

This bug report was last modified 158 days ago.

Previous Next


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