【问题标题】:Syntax read error: )语法读取错误:)
【发布时间】:2013-01-24 05:22:48
【问题描述】:

我正在尝试设置像 this guy 这样的 emacs 环境,但我不断收到这个该死的错误:

Syntax read error: )

这是我的 init.el 文件的样子,它并不长,但我不知道其中的任何含义。我是 lisp 的新手。

(add-to-list 'load-path' "~/.emacs.d/auto-complete-1.3.1")
;Load the default configuration
(require 'auto-complete-config')
;Make sure we can find the dictionaries
(add-to-list 'ac-dictionary-directories' "~/.emacs.d/auto-complete-1.3.1/dict")
;Use dictionaries by default
(setq-default ac-sources (add-to-list 'ac-sources' 'ac-source-dictionary'))
(global-auto-complete-mode t)
;Start auto completion after two characters of a word
(setq ac-auto-start 2)
; case sensitivity is important when finding matches
(setq ac-ignore-case nil)

(add-hook 'js-mode-hook'
  (lambda ()
    ;;Scan the file for nested code blocks
    (imenu-add-menubar-index)
    ;;Activate folding mode
    (hs-minor-mode t))

【问题讨论】:

    标签: emacs elisp emacs23


    【解决方案1】:

    在最后对add-hook 的调用中有不平衡的括号。

    基本上,在最后的两个中添加一个额外的)

    如果您键入 Mx show-paren-mode RET 然后将光标定位在右括号之后,它将突出显示匹配的左括号(反之亦然,如果您将光标定位在左括号上)。

    【讨论】:

      【解决方案2】:

      您在某些符号的末尾有额外的引号。在 lisp 中,通过在表达式前面加上一个单引号 (') 来引用表达式,而不是其他任何地方:'correct'incorrect'。字符串文字与许多其他语言一样,前后都有双引号:"a string literal"

      此外,phils 指出的缺失括号。

      通常,您可以使用 --debug-init 启动 emacs,以使其对 init 文件中的任何错误进行回溯。在这种情况下,它不是很有用,因为代码甚至没有被评估。

      【讨论】:

      • 哈,我什至没有寻找其他问题,但我仍然不敢相信我没有看到所有那些无关的引号:)
      猜你喜欢
      • 1970-01-01
      • 2016-12-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-29
      • 1970-01-01
      相关资源
      最近更新 更多