Aquamacs + slime:启动时加载lisp文件
我正在运行Aquamacs + Slime,当我启动Aquamacs时,我可以自动启动Slime。 但是,当我尝试加载lisp文件后,我不断收到各种错误,具体取决于我如何加载文件。 这是我的偏好
(setq inferior-lisp-program "~/ccl/dx86cl64"
  slime-startup-animation nil)
(require 'slime)
(split-window-horizontally)
(other-window 1)
(slime)
(eval-after-load "slime"
   '(progn 
       (slime-compile-and-load-file "/Users/xxxxx/xxxxx/load-seq.lisp")
 )) 
我收到以下错误
error: Buffer *inferior-lisp* is not associated with a file.
  我试过其他的函数,包括load compile-and-load和slime-load-file并分别得到以下错误... 
Invalid read syntax: #
Symbol's function definition is void: compile-and-load
error: Not connected.
  当我这样做时,lisp文件加载(并编译)很好(load "/Users/xxxxx/xxxxx/load-seq.lisp") 。  这似乎是当我将它放入Preferences.el中时,即使我正在使用eval-after-load ,它也不会等待粘液eval-after-load 。 
  你碰巧误解了使用slime-compile-and-load-file函数。  它的文档说: 
 (slime-compile-and-load-file &optional POLICY) 
编译并加载缓冲区的文件并突出显示编译器注释。
该函数对已经与当前缓冲区关联的文件进行操作,并且它期望编译策略而不是文件名作为其(可选)参数。 所以你的代码应该是这样的:
(slime)
(add-hook 'slime-connected-hook
          (lambda ()
            (find-file "/Users/xxxxx/xxxxx/load-seq.lisp")
            (slime-compile-and-load-file)))
  slime-connected-hook包含SLIME连接到Lisp服务器时要调用的函数列表。 
但我不确定Emacs init文件是否可以加载这样的非Emacs Lisp代码。 CCL初始化文件将是一个更好的地方。 参考2.4。 用CCL手册中的初始文件进行个人定制。
  此外, load函数用于执行Emacs Lisp代码。  slime-load-file是一个正确的调用函数,但它恰好被称为太早(或在SLIME连接到Lisp服务器之前)。  如果它已被添加到slime-connected-hook它会起作用。  实际上,如果你没有一个有效的理由来编译Lisp代码,那么当你启动Emacs时,我想推荐使用slime-load-file来slime-compile-and-load-file (并且你真的想要这样做在Emacs中): 
(add-hook 'slime-connected-hook
          (lambda ()
            (slime-load-file "/Users/xxxxx/xxxxx/load-seq.lisp")))
  最后,没有称为compile-and-load函数。 
