unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 18851@debbugs.gnu.org
Subject: bug#18851: 24.4; emacs cannot be started if the current directory has been removed
Date: Wed, 29 Oct 2014 17:44:08 +0100	[thread overview]
Message-ID: <20141029164407.GP5545@ypig.lip.ens-lyon.fr> (raw)
In-Reply-To: <83d29a2722.fsf@gnu.org>

On 2014-10-29 18:07:33 +0200, Eli Zaretskii wrote:
> You can assume without testing that there will be problems, because
> Emacs expects to find a meaningful default-directory in *scratch*.

What will it do with this default-directory?

> > Well, it happens that the current directory is removed for some
> > reasons, either on purpose or because of some FS error (in particular
> > if the FS is remote). Now, I may have already an application running
> > with this current directory, for instance, a MUA. If I want to write
> > a mail, the MUA will start an editor on an absolute pathname, Emacs
> > in my case, with the same current directory. But Emacs cannot be
> > started, just because the current directory no longer exists, meaning
> > that I can't write my mail without restarting the whole application.
> 
> Can't you use the --chdir command-line argument to make Emacs start in
> a safe place?  Or does that not work in this situation?

It will work in some cases. But this means that it's not usable for
$EDITOR, because there are cases where the editor may be executed
with a relative pathname argument. In such a case, this argument
should be handled normally if the directory still exists. Otherwise
one should get either an error or the specified file (under Linux,
one can still open relative pathnames starting with ../ even though
the current working directory has been deleted), but getting another
file is not acceptable. With a --chdir to $HOME, there is a high risk
to get this wrong; to "/", the risk is lower, but still exists.

Unfortunately, it isn't even possible to --chdir to the old path
(obtained via /proc/$$/cwd under Linux), as the directory typically
no longer exists when I need to do that, and Emacs cannot chdir to
it, obviously. An option to set the default default-directory value
and accept non-existing directories[*] would be more useful.

[*] I suppose that this is not a problem since an existing directory
can be removed after Emacs is started, so that the default-directory
variable could point to a non-existing directory, and the current
Emacs version is fine with that (things still work, and errors are
reported gracefully).

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)





  reply	other threads:[~2014-10-29 16:44 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27 13:33 bug#18851: 24.4; emacs cannot be started if the current directory has been removed Vincent Lefevre
2014-10-28 21:34 ` Glenn Morris
2014-10-29  1:28   ` Vincent Lefevre
2014-10-29  3:50     ` Eli Zaretskii
2014-10-29  8:09       ` Vincent Lefevre
2014-10-29 12:57         ` Stefan Monnier
2014-10-29 14:27           ` Eli Zaretskii
2014-10-29 15:39             ` Vincent Lefevre
2014-10-29 16:07               ` Eli Zaretskii
2014-10-29 16:44                 ` Vincent Lefevre [this message]
2014-10-29 16:15               ` Andreas Schwab
2014-10-29 16:51                 ` Vincent Lefevre
2014-10-29 17:31                   ` Andreas Schwab
2014-10-29 17:45                     ` Vincent Lefevre
2014-10-29 18:23                       ` Ivan Shmakov
2014-10-29 21:11                         ` Andreas Schwab
2014-10-30  0:39               ` Stefan Monnier
2015-06-12  0:39                 ` Glenn Morris
2015-06-12  7:53                   ` Eli Zaretskii
2015-06-12 15:45                     ` Glenn Morris
2015-06-12 19:31                       ` Eli Zaretskii
2015-06-13  1:29                         ` Glenn Morris
2015-06-13  7:56                           ` Eli Zaretskii
2015-06-13 23:45                             ` Glenn Morris
2014-10-29 14:23         ` Eli Zaretskii
2014-10-29 15:39           ` Andreas Schwab
2014-10-29 16:00             ` Eli Zaretskii
2014-10-29 16:05           ` Vincent Lefevre
2014-10-29 16:21             ` Eli Zaretskii
2014-10-29  3:40   ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=20141029164407.GP5545@ypig.lip.ens-lyon.fr \
    --to=vincent@vinc17.net \
    --cc=18851@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).