【问题标题】:Saved theme in .emacs doesn't load on launch.emacs 中保存的主题在启动时不加载
【发布时间】:2013-12-30 17:25:29
【问题描述】:

我可以在自定义主题时加载 solarized-light 主题,但即使它在我的 .emacs 中,它也不会在启动时加载。这是为什么呢?

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 150 :width normal :foundry "apple" :family "Menlo"))))
 '(compilation-mode-line-fail ((t (:inherit compilation-error :foreground "dark cyan" :weight bold))) t)
 '(cursor ((t (:background "green1"))))
 '(rainbow-delimiters-depth-2-face ((t (:foreground "MediumOrchid1"))))
 '(rainbow-delimiters-depth-3-face ((t (:foreground "dark cyan"))))
 '(rainbow-delimiters-depth-4-face ((t (:foreground "light green"))))
 '(rainbow-delimiters-depth-5-face ((t (:foreground "HotPink1"))))
 '(rainbow-delimiters-depth-6-face ((t (:foreground "yellow1"))))
 '(slime-repl-inputed-output-face ((t (:foreground "gray100")))))

【问题讨论】:

  • 这只是您.emacs 的一部分,对吧?包含加载solarized代码的部分在哪里?另外,您使用的是什么版本的 Emacs?
  • @itsjeyd 我正在使用 emacs 24。我在主题的 .emacs 中没有任何其他内容;以前,我有 mysterioso 主题,它会自动启动。当我选择该主题时,必须由 emacs 添加该操作所需的任何代码。
  • AFAIK,solarized-light 不包含在默认的 Emacs 24 发行版中。你是如何安装它/你做了什么让它出现在运行customize-themes时出现的可用主题列表中?

标签: emacs emacs-faces


【解决方案1】:

这行得通:

(add-hook 'emacs-startup-hook
  (lambda ()
    (load-theme 'solarized-light)
    ))

【讨论】:

  • 你应该选择这个作为你的答案,因为它也解决了我的问题,显然它也解决了你的问题:)
  • 嘿,这也对我有用,你能解释一下为什么你必须这样改变它吗?
【解决方案2】:

我原来的答案是:

尝试将(load-theme 'solarized-light t) 添加到您的.emacs 文件的顶部。

【讨论】:

    猜你喜欢
    • 2013-07-16
    • 1970-01-01
    • 2015-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-28
    相关资源
    最近更新 更多