summaryrefslogtreecommitdiff
path: root/lisp/cus-edit.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-04-22 11:51:11 +0100
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-04-22 11:51:11 +0100
commit3beb6b8b86f62762f9969b2d2393098c498eb04e (patch)
tree96f7bc95d5760e6855c7a4186e9f39355a15dc61 /lisp/cus-edit.el
parent8991937a746d2c941a4be05ae5d053df93f2537e (diff)
downloademacs-3beb6b8b86f62762f9969b2d2393098c498eb04e.tar.gz
* lisp/cus-edit.el (custom-file): Consider init-file-had-error
In case `(and (null custom-file) init-file-had-error)' do the same thing we'd do if `(null user-init-file)', which is to either error out or return nil. This is in line with `custom-save-all' which would throw an error in that situation. (bug#20355)
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r--lisp/cus-edit.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index cd894f47263..9f57d0da24a 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -4377,7 +4377,8 @@ if only the first line of the docstring is shown."))
(defun custom-file (&optional no-error)
"Return the file name for saving customizations."
- (if (null user-init-file)
+ (if (or (null user-init-file)
+ (and (null custom-file) init-file-had-error))
;; Started with -q, i.e. the file containing Custom settings
;; hasn't been read. Saving settings there won't make much
;; sense.