海上月明

editer by sun
posts - 162, comments - 51, trackbacks - 0, articles - 8
   :: 首页 :: 新随笔 ::  :: 聚合  :: 管理

[转]emacs中如何编译扩展cedet

Posted on 2008-10-17 09:22 pts 阅读(1513) 评论(0)  编辑  收藏 所属分类: Emacs
转自:http://ifelseif.blog.sohu.com/53784656.html

自从学了一点vi之后,我还是很happy的用过一阵的。当初弃emacs投向vi,主要还是偷懒的因素比较多,emacs的快捷键太变态,功能太强中文资 料太少,令人不爽,vi现在已经有相当数量的中文资料了,光我博客上面这些,就够列位达到一定程度的半吊子水平了。vi打开速度飞快,而且在 windows下面vi也很happy。但是vi万事esc,是优点也是致命伤,那就是编辑命令简单到只有数字加字母,但是干什么都要伸手去够esc,太 费事了。如果你在vi里面写中文,那就要ctrl-space esc,敲个命令,然后i ctrl-space,简直是麻烦的要死。以前用vi写过一阵子论文,写着写着就崩溃了(是我本人崩溃不是vi),投降了。我老板是emacs的粉丝,特 别歧视用vi的人比如我,一看我开vi就鄙视我,整天emacs长vi短,恶~~受不鸟了,决定写完论文再把emacs学起来。

我们都是 被迫在windows的奴役下工作的人,相信我,我说的是实话。要问我什么时候能够抛弃windows,那就得看ESRI、Adobe和AutoDesk 什么时候抛弃它了,没办法生活就是这么一坨一坨的啊。windows里面还是有好的emacs可用的。最新有emacs23,完美中文支持,虽然还是 alpha版,可是代码足够稳定,好多人用着都没问题;稳定的话要emacs22.1,最新稳定版,要装mule才能有中文(又是小日本的东西,搞个中文 支持居然还要别人代劳,可见在不自由的中国自由软件是多么不流行啊)。可喜的是新水木的大拿给我们搞定了一个完美中文版,新水木emacs版上就有,5q 软件区现在还有种子,赫赫win下的懒人们由有福了。

可是emacs有好多扩展还是需要编译的,比方说cedet。有现成的emacs, 可是其他的gnu工具还得我们自己找。有个叫cygwin的,可以在windows中模拟完整的GNU/linux环境,可是速度比较慢。公认的还是 mingw比较不错,新水木的emacs就用这个编译出来的。光有mingw还不行,还要有autotools比方说make之类,这就要用msys 了,msys可以说是一个微型shell,可以执行自动配置脚本,有了它编译才能够顺利进行。我这几天的工作,就是在windows里面编译出个 cedet来。

mingw的老巢在这里
http://www.mingw.org/

msys的下载地址在这里,找的我好苦,教育网用代服很慢,而且好多链接是坏的。
prdownloads.sourceforge.net/mingw/MSYS-1.0.10.exe?download

先装mingw,装在哪里随你便,然后是msys,装的时候会问你mingw装在哪了,告诉他就行。说来简单,这就大功告成了。然后在开始菜单里找mingw-msys,点开就会出来一个终端,可以cd可以ls,只可惜又不认识中文,这下你该知道怎么办了吧^^

从sourceforge上拖下来cedet源码包,解压,然后进msys,cd过去,然后

make EMACS=“D:/EMACS/runemacs.exe”

上面是我的emacs路径,编译的时候换成自己的就成了,注意斜杠方向,windows和linux里面方向正好相反!

然后在.emacs文件中加入这么几行,其中load-file路径换成你自己的就好了

;; Load CEDET
(load-file "~/cedet-VERSION/common/cedet.el")

;; Enabling various SEMANTIC minor modes.  See semantic/INSTALL for more ideas.
;; Select one of the following:

;; * This enables the database and idle reparse engines
;;(semantic-load-enable-minimum-features)

;; * This enables some tools useful for coding, such as summary mode
;;   imenu support, and the semantic navigator
(semantic-load-enable-code-helpers)

;; * This enables even more coding tools such as the nascent intellisense mode
;;   decoration mode, and stickyfunc mode (plus regular code helpers)
;; (semantic-load-enable-guady-code-helpers)

;; * This turns on which-func support (Plus all other code helpers)
;; (semantic-load-enable-excessive-code-helpers)

;; This turns on modes that aid in grammar writing and semantic tool
;; development.  It does not enable any other features such as code
;; helpers above.
;; (semantic-load-enable-semantic-debugging-helpers)

OK,大功告成!参考了bethoven的日志,谨表谢意!

只有注册用户登录后才能发表评论。


网站导航: