From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vincent Lefevre Newsgroups: gmane.emacs.bugs Subject: bug#18851: 24.4; emacs cannot be started if the current directory has been removed Date: Wed, 29 Oct 2014 16:39:59 +0100 Message-ID: <20141029153959.GM5545@ypig.lip.ens-lyon.fr> References: <87h9ypiqmm.fsf@xvii.vinc17.org> <8k61f398u4.fsf@fencepost.gnu.org> <20141029012802.GS4400@xvii.vinc17.org> <83y4rz1qmj.fsf@gnu.org> <20141029080939.GT4400@xvii.vinc17.org> <83r3xr0x4u.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1414597284 13846 80.91.229.3 (29 Oct 2014 15:41:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Oct 2014 15:41:24 +0000 (UTC) Cc: 18851@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 29 16:41:18 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XjVN7-00030x-0k for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Oct 2014 16:41:17 +0100 Original-Received: from localhost ([::1]:46922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjVN6-0005T9-Mb for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Oct 2014 11:41:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjVMy-0005Sb-6Y for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2014 11:41:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjVMt-0006CI-N0 for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2014 11:41:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjVMt-0006CE-JD for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2014 11:41:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XjVMs-0003ZC-8X for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2014 11:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Oct 2014 15:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18851 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18851-submit@debbugs.gnu.org id=B18851.141459720913634 (code B ref 18851); Wed, 29 Oct 2014 15:41:02 +0000 Original-Received: (at 18851) by debbugs.gnu.org; 29 Oct 2014 15:40:09 +0000 Original-Received: from localhost ([127.0.0.1]:38933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjVM0-0003Xp-Rg for submit@debbugs.gnu.org; Wed, 29 Oct 2014 11:40:09 -0400 Original-Received: from ypig.lip.ens-lyon.fr ([140.77.13.48]:40527) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjVLv-0003XK-KT for 18851@debbugs.gnu.org; Wed, 29 Oct 2014 11:40:05 -0400 Original-Received: from vlefevre by ypig.lip.ens-lyon.fr with local (Exim 4.84) (envelope-from ) id 1XjVLr-00075o-CB; Wed, 29 Oct 2014 16:39:59 +0100 Content-Disposition: inline In-Reply-To: <83r3xr0x4u.fsf@gnu.org> X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.23-6365-vl-r59709 (2014-09-07) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95253 On 2014-10-29 16:27:13 +0200, Eli Zaretskii wrote: > > From: Stefan Monnier > > Cc: Eli Zaretskii , 18851@debbugs.gnu.org > > Date: Wed, 29 Oct 2014 08:57:16 -0400 [...] > > So the current Emacs C code really has no way to access a directory/file > > which is not accessible from the root directory. The problem is precisely when Emacs is called on a absolute pathname. Currently Emacs quits instead of working on this file. I repeat that I'm NOT asking that Emacs should work with a pathname relative to a removed 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* IMHO, if the current directory no longer exists, the default-directory of *scratch* can be nil. > . 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). emacs --eval '(setq default-directory nil) (find-file "~/out")' fails, but I wonder why. > But I'd still like to hear the real-life use case behind this report. 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. Note: in some cases, one can still use a wrapper to change the current directory to an existing one, but this can be a bit dangerous in general, because if there are relative pathnames, one can end up with loading/writing an incorrect file instead of getting an error. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)