【发布时间】:2016-01-17 06:27:38
【问题描述】:
我正在尝试编写一个 emacs 脚本以通过以下方式从命令行调用:
emacs --script script.el
当我尝试在所述脚本中包含 cl-defstruct 或 defstruct 时遇到问题。例如,当我使用 M-x eval-buffer 在 emacs 中运行它时,以下工作正常,但在作为脚本运行时失败:
(cl-defstruct test slot)
(setq myTest (make-test))
(setf (test-slot myTest) "hello")
(message (test-slot myTest))
上面应该只吐出消息“hello”但是当作为脚本运行时,我看到以下错误:
Loading 00debian-vars...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /etc/emacs/site-start.d/50python-docutils.el (source)...
Symbol's function definition is void: cl-defstruct
最后一行特别令人惊讶。任何想法为什么在此设置中无法识别 cl-defstruct 宏?谢谢!
【问题讨论】: