Open 4r1y4n opened 9 years ago
Not to be curt, but just to ensure I make the directions as clear as possible for everyone, can you start from https://github.com/sellout/emacs-color-theme-solarized/blob/master/README.md#installation--usage and let me know if you have any issues then? Thanks.
Actually I did ! I just summarized it here!
doing what https://github.com/sellout/emacs-color-theme-solarized/blob/master/README.md#installation--usage says (at Emacs 24 section) causes same error on startup:
Warning (initialization): An error occurred while loading `/home/r1y4n/.emacs':
File error: Cannot open load file, solarized-definitions
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the `--debug-init' option to view a complete error backtrace.
While the solarized-definitions.el is there:
r1y4n@r1y4n-PC:~/.emacs.d$ ls -l
total 156
drwx------ 3 r1y4n r1y4n 4096 Nov 29 18:29 ./
drwx------ 124 r1y4n r1y4n 69632 Nov 29 18:18 ../
drwx------ 2 r1y4n r1y4n 4096 Nov 29 18:21 auto-save-list/
-rw-rw-r-- 1 r1y4n r1y4n 1757 Jun 25 18:03 color-theme-solarized.el
-rw-rw-r-- 1 r1y4n r1y4n 41331 Jun 25 18:03 solarized-definitions.el
-rw-rw-r-- 1 r1y4n r1y4n 250 Nov 29 18:09 solarized-theme.el
Note: copying the directory doesnt load the theme (in emacs24 custom-theme-load-path
is the ~/.emacs.d and not any subdirectory is scanned)
Now It I know the problem is in solarized-theme.el
file.
If I change these:
(require 'solarized-definitions
(locate-file "solarized-definitions.el" custom-theme-load-path
'("c" "")))
to these:
(require 'solarized-definitions
(locate-file "/home/r1y4n/.emacs.d/solarized-definitions.el"
'("c" "")))
The theme loads properly. So the problem is in the path variable!
What is the value of custom-theme-load-path
?
Also, if you have the source files in .emacs.d/
, you haven't followed the README directions. In general, I would recommend against putting multiple files from a single package directly in .emacs.d/
and would also recommend against adding .emacs.d/
to custom-theme-load-path
.
it is:
(custom-theme-directory t)
and the value of custom-theme-directory
itself is
"~/.emacs.d/"
I'm on default installation of emacs24 on ubuntu 14.04
I didn't add anything to custom-theme-load-path
it is its default value!
if I put the emacs-color-theme-solarized
folder in .emacs.d/
(and not directly source files in there) it doesn't load the theme at all ! and gives:
error: Unable to find theme file for `solarized'
Right, the README directs you to add something to custom-theme-load-path
. Once you put the directory in .emacs.d
, you should add ~/.emacs.d/emacs-color-theme-solarized/
to custom-theme-load-path
.
I believe custom-theme-load-path
is broken as defined, because functions that take path lists (like locate-file
) don't interpret symbols (like custom-theme-directory
) as variables (although I wouldn't be against adding support for that) and certainly shouldn't interpret t
as etc/themes/
.
And anything that attempted to put part of the theme in custom-theme-load-path
And another part in load-path
would be more complicated than just pointing custom-theme-load-path
at Solarized.
I'll submit an issue against emacs about the custom-theme-load-path
behavior, but in general, I don't think it's a big deal, because it's much better to not put the sources from multi-file packages directly in .emacs.d
.
Right, by adding a
(add-to-list 'custom-theme-load-path "~/.emacs.d/emacs-color-theme-solarized")
to .emacs
file solves it; but believe me README doesn't mention it ;-) (I expected that emacs should scan dirs automatically)
Thank you very much
The first step in the instructions is “Add the emacs-color-theme-solarized
directory to your Emacs custom-theme-load-path
.”
I'm happy to rephrase it to be clearer, if you have any suggestions.
;-)
I understood it as "Copy emacs-color-theme-solarized
directory to where custom-theme-load-path
variable points to".
Maybe this can be a more clear sentence:
Copy emacs-color-theme-solarized
directory to your desired location (e.g. ~/.emacs.d ) and add its path to custom-theme-load-path
variable.
Thank you anyway and excuse me for wasting your time ;-)
I am having similar issue on MacOS, I don't have custom-theme-load-path
defined. And emacs version is 24+.
$ emacs --version
GNU Emacs 24.5.1
Copyright (C) 2015 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
funny thing is (Load-theme 'solarized t)
works. but not (Load-theme 'solarized-dark t)
here's my init.el
- https://github.com/prayagupd/dotfiles-mac/blob/master/.emacs.d/init.el
@prayagupd There are no longer solarized-dark
and solarized-light
themes, there’s only solarized
, and dark/light is set via the frame’s background-mode
(so you can have some dark frames and some light), as described at https://github.com/sellout/emacs-color-theme-solarized#all-versions
@sellout I'm stupid. I was using this theme with ubuntu for years. I just copied to macos and I was wondering why it doesn't work. Went through README too, but I'm really stupid that I couldn't notice the change.
I saw (set-frame-parameter nil 'background-mode 'dark)
. Will check. Thanks
No worries. It’s not like I version or have a changelog or anything. I gotta fix that.
I'm using emacs
24.3.1
and i'm trying to load solarized theme:I copied
into my
~/.emacs.d
then I run
M-x load-theme
-> solarized orM-x customize-themes
-> check solarized in both ways I get "cannot open load file: solarized-definitions" !What is the problem?