2006-10-14

Emacs ECB 的安装(转载)

ECB 是Emacs中浏览代码的一个工具,今天刚装了,感觉不错 。下面分享一下安装的方法,嘿嘿。由于是参考了别人的安装方法,所以原文转载:

一、下载
ECB是CEDET工具包中的一项,可以从以下地址下载:
http://sourceforge.net/projects/ecb/
他还需要其她几个软件包
speedbar
eieio
semantic
下载地址:
http://sourceforge.net/projects/cedet/

将这几个软件包解压到emacs的目录下,我的emacs配置目录为
/usr/local/share/emacs/21.1/
site-lisp/
ecb
speedbar
eieio
semantic

然后进行配置,顺序为:speedbar eieio semantic ecb

二、配置
1.speedbar配置
在site-lisp/subdirs.el中加入
(add-to-list 'load-path "/path/speedbar")
我的为:
(add-to-list 'load-path "/usr/local/share/emacs/speedbar")
然后加入:
(autoload 'speedbar-frame-mode "speedbar" "Popup a speedbar frame" t)
(autoload 'speedbar-get-focus "speedbar" "Jump to speedbar frame" t)
(global-set-key [(f4)] 'speedbar-get-focus)


如果你用Emacs,加入:
(define-key-after (lookup-key global-map [menu-bar tools])
[speedbar] '("Speedbar" . speedbar-frame-mode) [calendar])

如果你用XEmacs,加入:
(add-menu-button '("Tools")
["Speedbar" speedbar-frame-mode
:style toggle
:selected (and (boundp 'speedbar-frame)
(frame-live-p speedbar-frame)
(frame-visible-p speedbar-frame))]
"--")

;; Texinfo fancy chapter tags
(add-hook 'texinfo-mode-hook (lambda () (require 'sb-texinfo)))

;; HTML fancy chapter tags
(add-hook 'html-mode-hook (lambda () (require 'sb-html)))
(autoload 'rpm "sb-rpm" "Rpm package listing in speedbar.")
;; w3 link listings
(autoload 'w3-speedbar-buttons "sb-w3" "s3 specific speedbar button generator.")

XEmacs Emacs 20.2版本以前的加入:
;; chapter listings
(autoload 'Info-speedbar-buttons "sb-info" "Info specific speedbar button generator.")
;; folder listings
(autoload 'rmail-speedbar-buttons "sb-rmail" "Rmail specific speedbar button generator.")
;; current stack display
(autoload 'gud-speedbar-buttons "sb-gud" "GUD specific speedbar button generator.")
以后的加入
(eval-after-load "info" '(require 'sb-info))


2.eieio 配置
在site-lisp/subdirs.el中加入
(add-to-list 'load-path "/path/eieio")
我的为:
(add-to-list 'load-path "/usr/local/share/emacs/eieio")


3.semantic 配置
在site-lisp/subdirs.el中加入
(add-to-list 'load-path "/path/to/semantic")
(setq semantic-load-turn-everything-on t)
我的为:
(add-to-list 'load-path "/usr/local/share/emacs/semantic")
(setq semantic-load-turn-everything-on t)

4.ecb 配置

在site-lisp/subdirs.el中加入
(add-to-list 'load-path "/path/ecb")
我的为:
(add-to-list 'load-path "/usr/local/share/emacs/ecb")

在~/.emacs中加入
(require 'ecb)

三、使用

M-x ecb-activate 激活ECB
M-x ecb-show-help 查看帮助


四、其它

如果你想加速这些程序的执行,那么就要将EL文件编译成ELC文件。
查看相应程序的Makefile文件,修改LOADPATH变量,然后make即可

没有评论:

发表评论