之前网上看http://blog.youkuaiyun.com/redguardtoo/article/details/7222501的文章,极力推荐purcell的配置,所以为了不少走弯路,就试着配置。
一.安装
1.purcell大神的emacs配置文件url:
https://github.com/purcell/emacs.d
2.删除原先的.emacs.d目录,然后
git clone https://github.com/purcell/emacs.d.git ~/.emacs.d
3.删除原先的.emacs配置文件
4.启动emcas,一阵下载和编译后,就完成了。
二.使用
1.common lisp
(1).安装sbcl
(2)直接在emcas中使用M -X slime会出现下面的错误
apply: Searching for program: 没有那个文件或目录, lisp
估计是没有安装cmucl,所以找不到了。
貌似没有也没啥影响,所以直接删除cmucl算了。
~/.emacs.d/init-common-lisp.el
修改前:
(eval-after-load 'slime
'(progn
(add-to-list 'slime-lisp-implementations
'(sbcl ("sbcl") :coding-system utf-8-unix))
(add-to-list 'slime-lisp-implementations
'(cmucl ("lisp") :coding-system iso-latin-1-unix))))
修改后:
(eval-after-load 'slime
'(progn
(add-to-list 'slime-lisp-implementations
'(sbcl ("sbcl") :coding-system utf-8-unix))
t))
(3)
重启emacs后,进入slime,结果出现如下错误
Couldn't load "~/.emacs.d/elpa/slime-20100404.1/swank-loader.lisp":
file does not exist.
解决方法:
-----------------
http://drunkedcat.diandian.com/post/2013-02-21/40049514976
1, 先下载 cvs 版的 slime : cvs -d :pserver:anonymous:anonymous@common-lisp.net:/project/slime/cvsroot co slime-cvs
2, 按日期更新(其实是更“旧”)到 20100404 之后一两天的 cvs : cd slime-cvs && cvs -q update -D "2010-04-06 10:00:0 GMT"
3, 用这个版本中的 swank-loader.lisp 来启动,就可以了, 注意这个版本中还需要显式地指定网络编码,如 (swank:create-server :port 8005 :style :spawn :dont-close t :coding-system "utf-8-unix") 这样的形式,否则 utf8 编码会出网络错误
(defun slime-attempt-connection (process retries attempt)
;; A small one-state machine to attempt a connection with
;; timer-based retries.
(let ((file (slime-swank-port-file)))
(unless (active-minibuffer-window)
(message "Polling %S.. (Abort with `M-x slime-abort-connection'.)" file))
(cond ((and (file-exists-p file)
修改后:
(defun slime-attempt-connection (process retries attempt)
;; A small one-state machine to attempt a connection with
;; timer-based retries.
(let ((file (slime-swank-port-file)))
(cond ((and (file-exists-p file)
这样重启emacs后,就没有错误信息了。不过问题还在,只能等以后在看能否解决了...(要是有哪位有解决方法还请千万留言告知)
;;(setq ac-expand-on-auto-complete nil)
;;(setq ac-auto-start nil)
重启之后,就自动开启了自动补齐功能了。