]> git.eshelyaron.com Git - emacs.git/commitdiff
Let Emacs start even if curdir is inaccessible
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 17 Aug 2020 23:21:36 +0000 (16:21 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 17 Aug 2020 23:22:10 +0000 (16:22 -0700)
* 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

index bff10003f848a106507d016348870ad3548c5d99..364689ccdbffa5a3044ff0449a13f1518685a0a8 100644 (file)
@@ -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)))))