emacs配置

之前网上看http://blog.csdn.net/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 编码会出网络错误

---------------
我的环境中按照上面的做了之后,虽然可以正常启动slime,但是会一直有下面的error message输出
Polling "/tmp/slime/28940".. (Abort with `M-x slime-abort-connection')
非常讨厌。
因为没有找到解决方法,而且slime已经能正常使用了,所以只能眼不见为净,直接屏蔽这个message算了。
~/.emacs.d/elpa/slime-20100404.1/slime.el
修改前
(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后,就没有错误信息了。不过问题还在,只能等以后在看能否解决了...(要是有哪位有解决方法还请千万留言告知)

2.背景配色
貌似默认是light的配色,可以M-X dark 选择暗色的,感觉看着比较爽。
或者直接自己指定其他的(~/.emacs.d/init-themes.el)

3.自动补全
如果不进行修改配置,自动补全差不多可以说是被关闭的,需要使用META+TAB才会出现补全候选。
可以如下方式开启自动补全
~/.emacs.d/init-auto-complete.el
注释掉下面2行
;;(setq ac-expand-on-auto-complete nil)
;;(setq ac-auto-start nil)
重启之后,就自动开启了自动补齐功能了。

4.C-X C-f打开文件
目前的配置,c-x c-f打开文件时,自动匹配老匹配到已经存在的其他目录下的同名文件。

解决方法:
C-X C-F 之后,在输入文件名之前,先输入C-F,就可以关闭自动匹配模式。

5.待续











  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值