]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/cus-edit.el (custom-file): Consider init-file-had-error
authorArtur Malabarba <bruce.connor.am@gmail.com>
Wed, 22 Apr 2015 10:51:11 +0000 (11:51 +0100)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Wed, 22 Apr 2015 10:51:11 +0000 (11:51 +0100)
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)

lisp/cus-edit.el

index cd894f47263b1f6f7ed818a77640a71385e57fb6..9f57d0da24a3d6ccf4057f37c2abbe6e6265858b 100644 (file)
@@ -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.