After upgrading my OS (Ubuntu, from 18.04 to 19.04), my favorite text editor was automatically upgraded from Emacs 25 to Emacs 26. I then encountered a familiar error message at start-up:
File is missing: Cannot open load file, No such file or directory, color-theme
The relevant portion of my configuration file, .emacs
, is the
following:
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
(add-to-list 'load-path "/path/to/color-theme.el/file")
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
(color-theme-subtle-hacker)))
This works fine with emacs 25 or earlier versions, under Ubuntu
18.04. Naturally, the relevant file, color-theme-subtle-hacker.el
is
located in ~/.emacs.d/themes/
.
I imagine that there are at least two possible solutions to this problem:
(i) There is a way to "tell" Emacs 26 where is the relevant color-theme package. The problem could, in fact, be due to the OS upgrade.
(ii) I could also force Ubuntu 19.04 to use Emacs 25. However, I would have to install it manually, since every attempt at installing Emacs currently leads to version 26.
color-theme
"package", not that the color theme package can't find the theme you chose. I.e. it probably errors at(require 'color-theme)
. – Stefan Jan 18 '20 at 13:23color-theme.el
in yourload-path
, in your init file, before trying torequire
it. (If you haven't downloadedcolor-theme.el
then that's of course the first step.) – Drew Jan 18 '20 at 16:01load-path
is a list of directories, not absolute path(s) to file(s). The question states that the O.P. is adding an absolute file path of the color-theme file to theload-path
, instead of merely ensuring that the directory containing the file is added to theload-path
. – lawlist Jan 18 '20 at 17:48