0

I am currently using Zenburn. My .emacs file contains

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))

(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
(load-theme 'zenburn t)

I want to use tomorrow-night-bright. So, I placed the tomorrow-night-bright.el file in the same folder with zenburn.el. When I try

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))

(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
(load-theme 'tomorrow-night-bright t)

Emacs says it can't find the file/folder. When I use M-x customize-themes, it has it listed, but again can't find it when I try to execute it.

1

Investigation

You're working with this tomorrow-night-bright.el file, right? Here's the entirety of it:

(require 'color-theme-tomorrow)
(color-theme-tomorrow--define-theme night-bright)

It seems like that theme is organized a little bit differently from others. Let's compare it to Zenburn, the one that's currently working from your init file. Zenburn's file ends with

(provide-theme 'zenburn)

This lets you call (load-theme 'zenburn t) and have it work. Note that tomorrow-night-bright.el never calls provide-theme. So we can't just call load-theme on it. We have to find the location of the function color-theme-tomorrow--define-theme, and add it to our load path. By poking around the github repository, I found it here.

Fix

So, if we can't just call load-theme, what do we need to do? If you download the two files from the tomorrow-theme repository, put them on your load path. Then, you should be able to call this code:

(load "/path/to/tomorrow-night-bright-theme.el")
(load-theme 'tomorrow-night-bright t)

The first line will create the theme; the second one loads it.

Simpler alternative

Steve Purcell wrote a version of the tomorrow-night themes with "much more extensive face definitions" here. If you download one of those files (or install it from melpa), you should be able to just call load-theme on it.

  • I want to try the simpler alternative. I installed it with Melpa and put the el file in my themes folder. I can use M-x customize-themes and get it to work. But, when I add (load-theme 'sanityinc-tomorrow-bright t), it says it can't find the file. – Joe Johnson 126 Nov 29 '18 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.