bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18851: 24.4; emacs cannot be started if the current directory has be


From: Eli Zaretskii
Subject: bug#18851: 24.4; emacs cannot be started if the current directory has been removed
Date: Wed, 29 Oct 2014 16:27:13 +0200

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Eli Zaretskii <eliz@gnu.org>,  18851@debbugs.gnu.org
> Date: Wed, 29 Oct 2014 08:57:16 -0400
> 
> > The shell has no problems when the current directory has been
> > removed. It can still run without needing to switch to $HOME.
> 
> The problem is that the `emacs' process only access files using absolute
> file names (it basically doesn't use the process's current working
> directory, because every buffer has its own "current working
> directory"), so when the Emacs user thinks he's using a relative file
> name, Emacs really concatenates this relative file name to the value of
> `default-directory' and passes *that* to the OS.
> 
> So the current Emacs C code really has no way to access a directory/file
> which is not accessible from the root directory.

That's true, but my reading of the code is that the value of the
directory where Emacs was started is used for the following:

  . the default-directory of *scratch*
  . invocation-name and invocation-directory, if Emacs was invoked via
    a relative file name, like "../foo/bar/emacs".

In the first case, we could try using nil instead, maybe not all hell
will break lose.  The second case is rare even without the removal
(and makes no sense to me).

But I'd still like to hear the real-life use case behind this report.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]