我正在尝试根据http://david.rothlis.net/emacs/customize_colors.html在emacs 23中获得日光化的颜色主题。我已经将所有文件夹和文件放在〜/.emacs.d中。然后我添加:

(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0"')
(add-to-list 'load-path "~/.emacs.d/emacs-color-theme-solarized-master"')
(require 'color-theme)
(require 'color-theme-solarized)

到我的.emacs文件。但是,这给了我以下错误:
Warning (initialization): An error occurred while loading `/home/brain/.emacs':

Invalid read syntax: )

与调试多数民众赞成:
Debugger entered--Lisp error: (invalid-read-syntax ")")
eval-buffer(#<buffer  *load*> nil "/home/brain/.emacs" nil t)  ; Reading at buffer position 80
load-with-code-conversion("/home/brain/.emacs" "/home/brain/.emacs" t t)
load("~/.emacs" t t)
#[nil "\205\264

我从事此工作已经很长时间了,我似乎无法自己,在http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-Syntax.html#Init-Syntax,在SO或其他地方找到正确的方法。我对Linux很陌生,尽管我不认为这是造成这种情况的原因。任何帮助是极大的赞赏。谢谢。

PS这是我整个.emacs的样子:
(custom-set-variables
;; custom-set-variables 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.
)
(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 :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 83 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))))
(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0"')
(add-to-list 'load-path "~/.emacs.d/emacs-color-theme-solarized-master"')
(require 'color-theme)
(require 'color-theme-solarized)

最佳答案

为什么要引用整个内容?

(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0"')
(add-to-list'load-path "~/.emacs.d/emacs-color-theme-solarized-master"')

您不想要最后一个'。

您只想引用load-path,以便将它传递给add-to-list而不用
被评估。

尝试使用此:
(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0")
(add-to-list 'load-path "~/.emacs.d/emacs-color-theme-solarized-master")

有关更多信息,请参见:
add-to-list
load-path

除上述内容外,您可能需要在init.el中添加以下内容
将其放在`(需要'color-theme)'之后
(eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)
     ;; Load solarized at startup
     (color-theme-solarized)))

上面的代码来自颜色主题网站,我的声誉还不够高
发布更多的一个链接,否则我会包括它。

关于syntax-error - emacs 23中.emacs文件的正确语法是什么?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18466323/

10-16 22:40