trev-dev / tangonov-theme

A dark theme with ledgible, bright pastel colors for Emacs.
GNU General Public License v3.0
1 stars 3 forks source link

Theme doesn't load #1

Closed LevPetrovitch closed 2 years ago

LevPetrovitch commented 2 years ago

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'"

trev-dev commented 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?

furkanusta commented 2 years ago

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

trev-dev commented 2 years ago

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.

trev-dev commented 2 years ago

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.

LevPetrovitch commented 2 years ago

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.

furkanusta commented 2 years ago

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.

trev-dev commented 2 years ago

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 ) in the autoload. I currently load my custom-vars in early-init.el without any complaints from Emacs init.

trev-dev commented 2 years ago

@LevPetrovitch Have you had any luck?

trev-dev commented 2 years ago

Closing this for now. Please reply if you still need help.