Subject: Re: bug#37256: 27.0.50; Error (wrong-type-argument stringp nil) thrown when calling (load-theme 'solarized-dark t)

From: Paul Eggert <[email-masked]>
Date: Sun, 1 Sep 2019 09:59:53 -0700

Eli Zaretskii wrote:

> Paul, I think this is because user-emacs-directory is now nil
> initially.

Yes, that's it. Thanks for reporting it. I installed the attached patch.

I looked for preloaded defcustoms with similar issues, but didn't find any.
>From ba12c5467dadd228a00bcf972fd8415c26f4a4bd Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Sun, 1 Sep 2019 09:56:40 -0700
Subject: [PATCH] Fix load-theme bug with user-emacs-directory

* lisp/custom.el (custom-theme-directory): Delay initialization,
since the value depends on user-emacs-directory (Bug#37256).
---
 lisp/custom.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/custom.el b/lisp/custom.el
index 9bd9712b65..2e42ea73c1 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1137,6 +1137,7 @@ custom-theme-directory
 The command `customize-create-theme' writes theme files into this
 directory.  By default, Emacs searches for custom themes in this
 directory first---see `custom-theme-load-path'."
+  :initialize #'custom-initialize-delay
   :type 'string
   :group 'customize
   :version "22.1")
-- 
2.17.1