A、 下载地址:
cscope-15.5.tar.gz http://sourceforge.net/projects/cscope =
ecb-2.32.tar.gz http://sourceforge.net/projects/ecb
其中ecb还需要另外三个包:eieio,semantic,speedbar,地址是
http://sourceforge.net/projects/cedet
B、安装ecb和三个支持包:
#cd /usr/share/emacs/site-lisp
#tar zxfv ecb-2.32.tar.gz
#tar zxfv eieio-0.17.tar.gz
#tar zxfv semantic-
1.4.4
.tar.gz
#tar zxfv speedbar-0.14beta4.tar.gz
做四个连接
ln -s ecb-2.32 ecb
ln -s eieio-0.17 eieio
ln -s semantic- 1.4.4 semantic
ln -s speedbar-0.14beta4 speedbar
然后修改site-start.el文件,若在site-lisp目录下面没有此文件,可以新建。添加以下五行
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/eieio")))
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/semantic")))
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/speedbar")))
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/ecb")))
(require 'ecb)
重新启动一下emacs,执行M-x ecb-activate。哈哈,屏幕的左边出现了ecb的几个分栏窗口,从上到下依次是目录树、当前文件所在目录、变量和函数、历史。
C、安装cscope
$tar zxfv cscope-15.5.tar.gz
$cd cscope-15.5
$./configure && make && make install
然后把contrib/xcscope/目录下的cscope-indexer复制到PATH目录比如/usr/local/bin,把xcscope.el复制到/usr/share/emacs/site-lisp。修改/usr/share/emacs/site-lisp/site-start.el,添加(require 'xcscope)。
至此,整个过程就完全完成了,现在可以在emacs下面高效地读源码了。
2.在配制文件 .emacs中加上
;; Load CEDET
(load-file "/home/Harrison/Emacs/cedet-1.0pre4/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)
不知道什么原因,ecb和cedet不能同时使用。请高手指点!
ecb于cedet可以共存了,就是要先加载cedet,再加载ecb就好了。不过有个问题,ecb的函数列表有时会没有内容。(20071010)