Re: How is default-directory a safe variable?

Stefan Monnier via Users list for the GNU Emacs text editor <[email protected]> Mon, 13 Jul 2026 10:12:20 -0400
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
> Maybe it would be "safer" if a file local binding of `default-directory'
> would only be considered as safe if that directory is not something on a
> different machine?

For the use of `compile.el`, a remote directory should also be allowed.
The reason why it's safe is that `compile.el` sets it to a directory
that the user explicitly specified in some earlier instance of
`compilation-start`.

So I think the solution should likely by much more specific to
`compile.el`, e.g. when `compile.el` adds the file-local setting of the
var, it could add that specific directory into a list of "directories
safe for compile.el".


=== Stefan