Emacs 24:无法找到“sunized-dark”的主题文件。 [英] Emacs 24: Unable to find theme file for `solarized-dark.
问题描述
我在Mac 10.9.5使用Emacs 24.4
按照这里的说明: https://github.com/sellout/emacs-color-theme-solarized ,我下载了 emacs-color-theme -solarized
目录,并将其添加到我的Emacs custom-theme-load-path中。该目录( Emacs
已安装 Macports
)如下所示:
ls /opt/local/share/emacs/24.4/etc/themes/
/ pre>
adwaita-theme.el light-blue-theme.el tsdh-dark-theme .el
deep-blue-theme.el manoj-dark-theme.el tsdh-light-theme.el
dichromacy-theme.el misterioso-theme.el wheatgrass-theme.el
emacs-color-theme-solarized tango-dark-theme.el whiteboard-theme.el
leuven-theme.el tango-theme.el wombat-theme.el
其中
emacs-color-theme-sunized
是目录。然后我将添加到我的
.emacs
文件中,当我重新启动emacs
我收到错误:无法找到'sunized-dark
的主题文件。
我试图将
emacs-color-theme-sunized
目录中的所有文件直接移动到/ opt /本地/ share / emacs / 24.4 / etc / themes /
目录,这样:ls / opt / local / share / emacs / 24.4 / etc / themes /
LICENSE leuven-theme.el tango-dark-theme.el
README.md light-blue-theme.el tango-theme.el
adwaita-theme.el makepkg.sh tsdh-dark-theme.el
color-theme-solarized-pkg.el manoj-dark-theme.el tsdh-light-theme.el
color-theme-solarized.el misterioso-theme.el wheatgrass-theme.el
deep-blue-theme.el sunized-dark-theme.el whiteboard-theme.el
dichromacy-theme.el sunized-definitions.el wombat-theme.el
emacs-color-theme-solarized solarized-light-theme.el
遵循相同的过程并获得相同的结果。最后,我在这里阅读: Emacs 24软件包系统初始化问题一个可能的解决方案是在我的
.emacs
文件的开头添加以下两行:code $(code code code code code $ c $ $ b所以我做了并获得了相同的结果。甚至手动加载主题:
load-theme
然后sunized-dark
不能解决问题。似乎对该目录的任何修改都被.emacs
忽略。
顺便说一句,我还尝试添加
(add-to-list'load-path/ opt / local / share / emacs / 24.4 / etc / themes)
到我的.emacs
文件以及(add-to-list'路径〜/ emacs.d / themes)
,而且也不成功。
如有任何使用,任何安装的主题,例如
(load-theme'tsdh-dark t)
,完美工作
如何解决这个问题的太阳主题的任何想法?
感谢新年快乐!
解决方案Emacs 24包含<一个href =http://www.emacswiki.org/emacs/ELPA =nofollow noreferrer>
package.el
,我强烈推荐使用它来尽可能安装软件包。 Solarized主题的版本可从 MELPA Stable , MELPA 和果酱。
如果您尚未使用任何这些软件包存储库,则需要通过将这样的内容添加到您的init文件中:
(require'package)
(package-initialize)
(add-to-list'package-archives
'(melpa-stable。http://stable.melpa.org/packages/)t)
然后使用
Mx package-list-packages
,搜索color-theme-sanityinc-sunized
,mark它使用i
进行安装,然后使用x
安装标记的软件包。我发现这个包列表界面非常方便地发现新的包。
这样安装的包通常进入
〜/ .emacs.d / elpa /
,例如〜/ .emacs.d / ELPA /彩色主题solarized-2.27 /
。这应该自动添加到自定义主题加载路径
,这是load-theme
需要工作的。
请注意,这个特定版本包含两个以包维护者名称为前缀的主题,因此您必须执行类似
(load-theme'sanityinc-sunized-dark);或
(负载主题'sanityinc-solarized-light)
使主题加载。交互地,
load-theme
支持选项卡完成,这可能是查看实际调用的主题的最佳方式。
<除此之外,您还可以查看自动化package.el
安装进程,如果您在多台计算机上工作,这是非常方便的。I am on Mac 10.9.5 using Emacs 24.4
Following the instruction in here: https://github.com/sellout/emacs-color-theme-solarized , I downloaded the
emacs-color-theme-solarized
directory and added it to my Emacs custom-theme-load-path. That directory (Emacs
was installed withMacports
) looks like this :ls /opt/local/share/emacs/24.4/etc/themes/ adwaita-theme.el light-blue-theme.el tsdh-dark-theme.el deeper-blue-theme.el manoj-dark-theme.el tsdh-light-theme.el dichromacy-theme.el misterioso-theme.el wheatgrass-theme.el emacs-color-theme-solarized tango-dark-theme.el whiteboard-theme.el leuven-theme.el tango-theme.el wombat-theme.el
where
emacs-color-theme-solarized
is the directory. Then I added(load-theme 'solarized-dark t)
to my.emacs
file and when I re-initiateemacs
I get the error:Unable to find theme file for 'solarized-dark
.I have tried to move all file within the
emacs-color-theme-solarized
directory directly into the/opt/local/share/emacs/24.4/etc/themes/
directory, so that:ls /opt/local/share/emacs/24.4/etc/themes/ LICENSE leuven-theme.el tango-dark-theme.el README.md light-blue-theme.el tango-theme.el adwaita-theme.el makepkg.sh tsdh-dark-theme.el color-theme-solarized-pkg.el manoj-dark-theme.el tsdh-light-theme.el color-theme-solarized.el misterioso-theme.el wheatgrass-theme.el deeper-blue-theme.el solarized-dark-theme.el whiteboard-theme.el dichromacy-theme.el solarized-definitions.el wombat-theme.el emacs-color-theme-solarized solarized-light-theme.el
follow the same process and obtained the same result. Finally, I read here: Emacs 24 Package System Initialization Problems that a possible solution is adding the following two lines at the beginning of my
.emacs
file:(setq package-enable-at-startup nil) (package-initialize)
So I did and obtained the same result. Even loading the theme manually:
load-theme
and thensolarized-dark
is not solving the issue. It seems like any changes done to that directory are ignored by.emacs
.By the way, I also tried to add
(add-to-list 'load-path " /opt/local/share/emacs/24.4/etc/themes")
to my.emacs
file as well as(add-to-list 'load-path " ~/emacs.d/themes")
, and it was, also, unsuccessful.In case is of any use, any of the themes that come with the instalation, e.g
(load-theme 'tsdh-dark t)
, work perfectlyAny ideas of how to solve this issue for the solarized theme?
thanks and happy new year!
解决方案Emacs 24 includes
package.el
, and I strongly recommend using that to install packages whenever possible. Versions of the Solarized theme are available from MELPA Stable, MELPA, and Marmalade.If you haven't used any of these package repositories yet, you'll need to add one by putting something like this in your init file:
(require 'package) (package-initialize) (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t)
Then use
M-x package-list-packages
, search forcolor-theme-sanityinc-solarized
, mark it for installation withi
and then install marked packages withx
. I find this package list interface very handy for discovering new packages.Packages installed this way generally go into
~/.emacs.d/elpa/
, e.g.~/.emacs.d/elpa/color-theme-solarized-2.27/
. This should automatically be added to yourcustom-theme-load-path
, which is required forload-theme
to work.Note that this particular version includes two themes prefixed with the package maintainer's name, so you'll have to do something like
(load-theme 'sanityinc-solarized-dark) ; or (load-theme 'sanityinc-solarized-light)
to make the theme load. Interactively,
load-theme
supports tab completion, which is probably the best way to see what installed themes are actually called.As an aside, you might also want to look into tools for automating the
package.el
install process, which is especially handy if you work on multiple machines.这篇关于Emacs 24:无法找到“sunized-dark”的主题文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!