Don't create HOME if it doesn't exist

* lisp/files.el (locate-user-emacs-file): Don't create HOME if it
doesn't exist (bug#47298).  This returns us to Emacs 26.3
behaviour here.
This commit is contained in:
Lars Ingebrigtsen 2022-06-25 17:28:12 +02:00
parent 0808da91e3
commit 502e861af7

View file

@ -1115,10 +1115,17 @@ directory if it does not exist."
(if (file-directory-p user-emacs-directory)
(or (file-accessible-directory-p user-emacs-directory)
(setq errtype "access"))
(with-file-modes ?\700
(condition-case nil
(make-directory user-emacs-directory t)
(error (setq errtype "create")))))
;; We don't want to create HOME if it doesn't exist.
(if (and (not (file-exists-p "~"))
(string-prefix-p
(expand-file-name "~")
(expand-file-name user-emacs-directory)))
(setq errtype "create")
;; Create `user-emacs-directory'.
(with-file-modes ?\700
(condition-case nil
(make-directory user-emacs-directory t)
(error (setq errtype "create"))))))
(when (and errtype
user-emacs-directory-warning
(not (get 'user-emacs-directory-warning 'this-session)))