본문 바로가기
【Fundamental Tech】/Linux

Emacs Code Browser (ECB)

반응형

▣ 원문 출처: http://funkylocker.tistory.com/entry/linux-Emacs-Code-Browser-ECB

ECB는 개발자를 위한 source code navigator의 역할을 수행하는 프로그램으로 http://ecb.sourceforge.net/ 에서 다운로드 받을 수 있으며, 해당 사이트에서 모든 정보를 확인 할 수 있습니다.

ECB를 로드하기 위해서는 별도의 패키지가 필요합니다. 해당 패키지는 http://cedet.sourceforge.net/ 에서 받을 수 있습니다. 아래의 과정은 ecb-2.43.tar.gz과 cedet-1.0pre4.tar.gz을 다운로드 받아 진행합니다.
(※ 참고로 ECB는 emacs 21 이상 버전에서 동작됩니다.)

[설정 방법]

$ mkdir app
$ cd app
$ mv ~/download/ecb-2.43.tar.gz ~/download/cedet-1.0pre4.tar.gz .
$ tar xvfz ecb-2.43.tar.gz
$ tar xvfz cedet-1.0pre4.tar.gz
마지막으로 .emacs 파일을 읽어 들여 아래에 표시된 내용과 같이 cedet를 로드하고, ecb의 path를 지정합니다.
(load-file "/path/to/ecb/ecb.el")
(add-to-list 'load-path "/path/to/your/ecb/installation/directory")
(require 'ecb)


사용상 편의를 위해서 창간 이동을 위해 키를 정의할 수도 있습니다. 내용은 아래 customize the keys for ECB를 참고하시기 바랍니다.

[.emacs]
; Load CEDET
(load-file "~/app/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)

(add-to-list 'load-path "~/app/ecb-2.32/")
(require 'ecb)
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(ecb-fix-window-size (quote width))
 '(ecb-layout-name "left1")
 '(ecb-layout-window-sizes (quote (("left9" (0.32857142857142857 . 0.9791666666666666)))))
 '(ecb-options-version "2.32")
 '(ecb-windows-width 0.33))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )

;; customize the keys for ECB
(define-key ecb-mode-map (kbd "M-1") 'ecb-goto-window-directories)
(define-key ecb-mode-map (kbd "M-2") 'ecb-goto-window-sources)
(define-key ecb-mode-map (kbd "M-3") 'ecb-goto-window-methods)
(define-key ecb-mode-map (kbd "M-4") 'ecb-goto-window-history)
(define-key ecb-mode-map (kbd "M-5") 'ecb-goto-window-compilation)
(define-key ecb-mode-map (kbd "M-0") 'ecb-goto-window-edit1)

;; auto ecb mode
(setq ecb-auto-activate 'true)
(put 'scroll-left 'disabled nil)

반응형