summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2008-10-28 11:35:02 +0000
committerJuanma Barranquero <lekktu@gmail.com>2008-10-28 11:35:02 +0000
commit2bea27959e1b39947f0f0b25af01c5208f0c2c19 (patch)
treee6e6875cb9564ff185aaf01e13dccc94c2f65a08 /lisp/subr.el
parenteeaa563e845eff94719aa61f62c93ffcc3e11a14 (diff)
downloademacs-2bea27959e1b39947f0f0b25af01c5208f0c2c19.tar.gz
* subr.el (locate-user-emacs-file): Simplify. Don't create
`user-emacs-directory' when Emacs is running in batch mode.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 0dda4b0e604..f0fe7be0700 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2169,10 +2169,12 @@ directory if it does not exist."
(at-home (and old-name (expand-file-name old-name home))))
(if (and at-home (file-readable-p at-home))
at-home
- (unless (or purify-flag ;; don't create dir while dumping
- (file-accessible-directory-p
- (directory-file-name user-emacs-directory)))
- (make-directory user-emacs-directory t)) ;; don't catch errors
+ ;; Make sure `user-emacs-directory' exists,
+ ;; unless we're in batch mode or dumping Emacs
+ (or noninteractive
+ purify-flag
+ (file-accessible-directory-p (directory-file-name user-emacs-directory))
+ (make-directory user-emacs-directory))
(expand-file-name new-name user-emacs-directory)))))