CEDET/ECB for Aquamacs

OSX 2011. 5. 18. 17:18

http://docwhat.org/2010/08/cedet-ecb-for-aquamacs/

에서 퍼옴


CEDET

  1. Download the latest CEDET from sourceforge
  2. Untar the file in ~/Library/Application Support/Aquamacs Emacs:
    cd ~/Library/Application Support/Aquamacs Emacs
    tar xf ~/Downloads/cedet-1.0.tar.gz

  3. Run make:
    make EMACS=/Applications/Aquamacs.app/Contents/MacOS/Aquamacs


  4. Create a site-start.el file. This will be loaded automagically by Aquamacs. It should look like this. You should replace YOUR USERNAME with your OS X username.
    (/Applications/Aquamacs.app/Contents/Resources/lisp/aquamacs/site-start.el)

    (load-file "/Users/YOUR USERNAME/Library/Application Support/Aquamacs Emacs/cedet-1.0/common/cedet.el")
    (global-ede-mode 1) ; Enable the Project management system
    (semantic-load-enable-code-helpers) ; Enable prototype help and smart completion
    (global-srecode-minor-mode 1) ; Enable template insertion menu


  5. Now you need to pull all the .info files into a directory called info with a dir file. Aquamacs is smart enough to figure out this is plugin specific info files, and will use it.

    mkdir info
    cd info
    find .. -type f -name '*.info' | while read i; do j="$(basename $i)"; ln -s "$i" "$j"; install-info --info-dir="$(pwd)" "$j"; done


  6. Restart Aquamacs and you should have the full CEDET available, including docs.

ECB

ECB is the Emacs Code Browser. It basically turns Emacs into a full IDE like XCode.

  1. Download the latest ECB from sourceforge
  2. Untar the file in ~/Library/Application Support/Aquamacs Emacs:

    cd ~/Library/Application Support/Aquamacs Emacs
    tar xf ~/Downloads/ecb-2.40.tar.gz


  3. Create a site-start.el file to load up ECB on startup:

    (add-to-list 'load-path
    "/Users/docwhat/Library/Application Support/Aquamacs Emacs/ecb-2.40")

    ;; Choose one of the following...

    ;; If you want to load the complete ECB at (X)Emacs-loadtime
    ;; (Advantage: All ECB-options available after loading
    ;; ECB. Disadvantage: Increasing loadtime2):

    (require 'ecb)

    ;; If you want to load the ECB first after starting it by ecb-activate
    ;; (Advantage: Fast loading3. Disadvantage: ECB- and semantic-options
    ;; first available after starting ECB):

    ;(require 'ecb-autoloads)


  4. Symlink the info-help directory to info and create a dir file.

  5. ln -s info-help info
    cd info
    install-info --info-dir="$(pwd)" ecb.info

  6. Restart aquamacs and you should have ECB available, including docs.

.emacs ————————————————————————————————————————————————————

(set-language-environment “Korean”)

;; (set-terminal-coding-system 'utf-8)

;; (set-keyboard-coding-system 'utf-8)

;; (prefer-coding-system 'utf-8)

;; (set-default-coding-systems 'utf-8)

(set-terminal-coding-system 'euc-kr)

(set-keyboard-coding-system 'euc-kr)

(prefer-coding-system 'euc-kr)

(set-default-coding-systems 'euc-kr)

(set-default-font “apple-Bitstream_Vera_Sans_Mono-medium-normal-normal18-m-0-iso10646-1”)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; cedet 설정파일 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(load-file “~/Library/Application Support/Aquamacs Emacs/cedet/common/cedet.el”)

(global-ede-mode 1) ; Enable the Project management system

(semantic-load-enable-code-helpers) ; Enable prototype help and smart completion

(global-srecode-minor-mode 1) ; Enable template insertion menu

(global-set-key [(control tab)] 'senator-completion-menu-popup)

;; (global-set-key “\M-n” 'semantic-analyze-possible-completions)

;; (global-set-key “\M-n” 'semantic-complete-analyze-inline)

;; 처음 부터 . -> :: 기능을 사용하시려면 아래 “nil” 을 “t” 바꾸세요.

(defvar semantic-complete-self-insert-p t)

(defun semantic-complete-self-insert-toggle-switch ()

  (interactive)

  (if semantic-complete-self-insert-p

   (progn (setq semantic-complete-self-insert-p nil)

(message “semantic-complete-self-insert off”) )

   (progn (setq semantic-complete-self-insert-p t)

(message “semantic-complete-self-insert on”) ) ) )

(defun semantic-complete-self-insert-for-dot-operator (arg)

  (interactive “p”)

  (if semantic-complete-self-insert-p

   (call-interactively 'semantic-complete-self-insert)

   (self-insert-command arg) ) )

(defun semantic-complete-self-insert-for-arrow-operator (arg)

  (interactive “p”)

  (if (and semantic-complete-self-insert-p

(string= “-” (char-to-string (char-before (point)) ) ) )

   (call-interactively 'semantic-complete-self-insert)

   (self-insert-command arg) ) )

(defun semantic-complete-self-insert-for-scope-operator (arg)

  (interactive “p”)

  (if (and semantic-complete-self-insert-p

(string= “:” (char-to-string (char-before (point)) ) ) )

   (call-interactively 'semantic-complete-self-insert)

   (self-insert-command arg) ) )

(defun c++-mode-additional-semantic-keys ()

  “Key bindings to add to `c++-mode'.”

  (define-key c++-mode-map [(control c)(control .)] 'semantic-complete-self-insert-toggle-switch)

  (define-key c++-mode-map “.” 'semantic-complete-self-insert-for-dot-operator)

  (define-key c++-mode-map “>” 'semantic-complete-self-insert-for-arrow-operator)

  (define-key c++-mode-map “:” 'semantic-complete-self-insert-for-scope-operator)

  )

(add-hook 'c++-mode-hook 'c++-mode-additional-semantic-keys)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ECB 설정파일 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(add-to-list 'load-path “~/Library/Application Support/Aquamacs Emacs/ecb-2.40”)

;; Choose one of the following…

;; If you want to load the complete ECB at (X)Emacs-loadtime

;; (Advantage: All ECB-options available after loading

;; ECB. Disadvantage: Increasing loadtime2):

(require 'ecb)

;; If you want to load the ECB first after starting it by ecb-activate

;; (Advantage: Fast loading3. Disadvantage: ECB- and semantic-options

;; first available after starting ECB):

;(require 'ecb-autoloads)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(require 'ido)

(ido-mode t)

(global-auto-revert-mode 1)

(require 'color-theme)

(color-theme-initialize)

(color-theme-arjen)

(add-to-list 'default-frame-alist '(alpha . (95 88)))

: