From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#18851: 24.4; emacs cannot be started if the current directory has been removed Date: Tue, 28 Oct 2014 17:34:59 -0400 Message-ID: <8k61f398u4.fsf@fencepost.gnu.org> References: <87h9ypiqmm.fsf@xvii.vinc17.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1414532178 18775 80.91.229.3 (28 Oct 2014 21:36:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Oct 2014 21:36:18 +0000 (UTC) Cc: 18851@debbugs.gnu.org To: Vincent Lefevre Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 28 22:36:11 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 1XjEQy-0007KX-Ut for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Oct 2014 22:36:09 +0100 Original-Received: from localhost ([::1]:41531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjEQy-0004X5-Hj for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Oct 2014 17:36:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjEQu-0004Wp-AJ for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 17:36:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjEQt-0007vF-9q for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 17:36:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjEQt-0007vB-5z for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 17:36:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XjEQs-0008Dj-FY for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 17:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Oct 2014 21:36: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.141453210331517 (code B ref 18851); Tue, 28 Oct 2014 21:36:02 +0000 Original-Received: (at 18851) by debbugs.gnu.org; 28 Oct 2014 21:35:03 +0000 Original-Received: from localhost ([127.0.0.1]:38049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjEPu-0008CG-JD for submit@debbugs.gnu.org; Tue, 28 Oct 2014 17:35:03 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:54909 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjEPs-0008Bo-Km for 18851@debbugs.gnu.org; Tue, 28 Oct 2014 17:35:00 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XjEPr-0006vo-I3; Tue, 28 Oct 2014 17:34:59 -0400 X-Spook: Serbian pre-emptive Taiwan Medco Forte NWO Islam X-Ran: xK;UA)6-=~Jg(A}M|ht{STlZIoXuVKKMq`T}bp4Y&P"@^.cSo>qLn%i_)NWbYAKs*_OQJA X-Hue: cyan X-Attribution: GM In-Reply-To: <87h9ypiqmm.fsf@xvii.vinc17.org> (Vincent Lefevre's message of "Mon, 27 Oct 2014 14:33:37 +0100") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) 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:95222 Vincent Lefevre wrote: > Emacs cannot be started if the current directory has been removed: It's easy to change that so that it switches to HOME instead (let's not worry about the case of HOME being missing too!); see patch at end. But then you run into the problem that `emacs -Q some-file' starts editing ~/some-file instead of /some/deleted/dir/some-file. So it probably still needs to throw an error and abort processing of any command-line option that involves a non-absolute file name (eg `emacs -l some-file' would also presumably do the wrong thing). So is it worth it? > My old bug report in the Debian BTS: > > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=687171 IMO there's really no point reporting Emacs problems that aren't specific to Debian (and this issues obviously isn't) to the Debian bug tracker. They just sit there for some lengthy period of time, and only if they get forwarded here does something happen. (Although I do look at the Debian Emacs bug reports and had looked at that one.) *** src/buffer.c 2014-10-04 08:20:24 +0000 --- src/buffer.c 2014-10-04 18:59:30 +0000 *************** *** 5299,5305 **** pwd = get_current_dir_name (); if (!pwd) ! fatal ("`get_current_dir_name' failed: %s\n", strerror (errno)); /* Maybe this should really use some standard subroutine whose definition is filename syntax dependent. */ --- 5299,5315 ---- pwd = get_current_dir_name (); if (!pwd) ! { ! fprintf (stderr, "Warning: `get_current_dir_name' failed: %s\n\ ! Trying to change to home directory...\n", strerror (errno)); ! if (getenv ("HOME")) ! { ! chdir (getenv ("HOME")); ! pwd = get_current_dir_name (); ! } ! if (!pwd) ! fatal ("`get_current_dir_name' failed: %s\n", strerror (errno)); ! } /* Maybe this should really use some standard subroutine whose definition is filename syntax dependent. */