Closed LevPetrovitch closed 2 years ago
Using the following simple init code, I can load the theme from melpa:
(unless (package-installed-p 'tangonov-theme)
(package-install 'tangonov-theme))
(load-theme 'tangonov t)
May I know more about how you're trying to load the theme?
I've installed using this command and it gave me the same error as Lev.
I've checked both monokai and darkokai themes and they have a section before (provide-theme..)
;;;###autoload
(when (and (boundp 'custom-theme-load-path) load-file-name)
(add-to-list 'custom-theme-load-path
(file-name-as-directory (file-name-directory load-file-name))))
It works when I add this to tangonov-theme.el
Curious, one would think that using package install and having (provide-theme 'tangonov)
would have been enough for all cases, not just during init.
Thanks for the feedback. I will address this later in the evening.
FYI I had a testing copy in my emacs.d folder, which was on the custom theme load path to begin with. This is how I missed this problem. Thanks for pointing it out again.
Sorry, but still doesn't work. Looking at other themes that do the culprit seems to be the absence of the following into tangonov-theme..el
;;;###autoload
(when load-file-name
(add-to-list 'custom-theme-load-path
(file-name-as-directory
(file-name-directory load-file-name))))
Which, in turns, produce the following line in tangonov-theme-autoloads.el
(when load-file-name (add-to-list 'custom-theme-load-path (file-name-as-directory (file-name-directory load-file-name))))
Without this, load-theme is unable to find the theme.
It is probably because of the (bound-and-true-p custom-theme-load-path)
part in the solution I had suggested.
It is defined in custom.el
and that requires the theme to be loaded after that.
This time, without any forgotten themes on my load path, it works...so I wonder, why is custom.el ready to go for me, but not for @LevPetrovitch? The bound-and-true-p
check is saving them from an init-breaking error, so I would prefer to consider the error handled.
An alternative idea would be to try `(with-eval-after-load 'custom
@LevPetrovitch Have you had any luck?
Closing this for now. Please reply if you still need help.
I installed the package via melpa but, when executing Esc-x load-theme tangonov all I get is an error message "Unable to find theme file for 'tangonov'"