>From 362ca83a3b9d74c51ac325a6490551272aa25f9a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 17 Aug 2020 16:21:36 -0700 Subject: [PATCH] Let Emacs start even if curdir is inaccessible * lisp/startup.el (normal-top-level): Also delete PWD if file-attributes fails for either $PWD or default-directory, instead of failing out of the top level. This fixes a regression from Emacs 26 (Bug#42903). --- lisp/startup.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/startup.el b/lisp/startup.el index bff10003f8..364689ccdb 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -649,11 +649,12 @@ It is the default value of the variable `top-level'." ;; Use FOO/., so that if FOO is a symlink, file-attributes ;; describes the directory linked to, not FOO itself. (or (and default-directory - (equal (file-attributes - (concat (file-name-as-directory pwd) ".")) - (file-attributes - (concat (file-name-as-directory default-directory) - ".")))) + (ignore-errors + (equal (file-attributes + (concat (file-name-as-directory pwd) ".")) + (file-attributes + (concat (file-name-as-directory default-directory) + "."))))) (setq process-environment (delete (concat "PWD=" pwd) process-environment))))) -- 2.17.1