A

A

Ruby with Emacs on MacOSX

시작은 여기 였었다. 스크린캐스트를 보자

http://platypope.org/yada/emacs-demo/

 

스크린캐스트에 나오는 환경을 구성하는 것은 다음 페이지를 참조하면 된다.

http://platypope.org/blog/2006/9/8/i-need-a-cool-european-accent

 

위 동영상을 보다보면 ECB 환경과 IDO 가 제일 눈에 들어왔다. Aquaemacs 에도 위 환경을 구축해 보자.

개발환경구성

ECB (Emacs Code Browser) install

  • cedet-1.0pre4

    1. CEDET (Collection of Emacs Development Environment Tools) (http://cedet.sourceforge.net/) 에서 다운로드
    2. 압축 풀기 : (~/.emacs.d/cedet-1.0pre4)
    3. make
    4. .emacs에 아래 내용 추가.

      1. (load-file "~/.emacs.d/cedet-1.0pre4/common/cedet.el")
  • ecb-2.3.2

    1.  http://ecb.sourceforge.net/ 에서 모듈 다운로드
    2. 압축 풀기 (~/.emacs.d/ecb-2.32)
    3. .emacs에 아래 내용 추가.

      1. (add-to-list 'load-path "~/.emacs.d/edb-2.32/")
      2. (require 'ecb)

 

실행 : Tools 메뉴에서 Start Code Browser (ECB) 선택

M-x ecb-customize-most-important 실행해서 환경 설정하기.

 

단축키 설정 (창간의 이동을 쉽게) : .emacs 파일에 아래와 같이 추가하자. (참고 : http://xeraph.com/emacs/emacs-code-browser)

;; 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-histories)
(define-key ecb-mode-map (kbd "M-5") 'ecb-goto-window-compilation)
(define-key ecb-mode-map (kbd "M-0") 'ecb-goto-window-edit1)

IDO package install

링크 : http://www.cua.dk/ido.html#install

설치는 심플하다 load-path 상에 위 링크에서 받은 ido.el 파일을 넣고나서 (대략 ~/.emacs.d/ 디렉토리에다 두면 된다) .emacs 파일에 다음과 같이 추가한다.

  1. ;ido
    ;(load-file "~/.emacs.d/ido.el")
    (require 'ido)
    (ido-mode t)

단축키 : C-x b

위와 같이 단축키를 입력하면 버퍼 리스트가 주욱 나온다. 버퍼에 있는 파일명을 타이핑하고 엔터 하면 해당 파일을 보여준다.

Tip : C-x C-r (Open Recent) 도 유용하게 쓸 수 있다.

Aquaemacs 설정

aquaemacs 는 기본적으로 파일들이 새로운 프레임에 열린다. 계속 새창이 뜬다는 얘기. 좀 짜증나는데 기본적으로 뜨지 않도록 하려면 .emacs 파일 같은데다가

(one-buffer-one-frame-mode nil)

와 같이 추가해서 기본적으로 false로 만들어 버리자. 혹은 Options 메뉴에서 "Display Buffers in Separate Frames"를 언체크하면 된다.

Emacs랑 친해지기

이맥스를 알게되는 순서대로 그냥 기술한 페이지, 내용이 좀 모이게되면 categorized 시켜야지..

처음기동!!

  1. [emacs] 실행하다

  2. [C-x, C-f] 파일을 열다

  3. [C+x,C+s] 저장

  4. [C+x,C+c] 끝내기

  5. [C+s,ENTER,C+w] 단어찾기 (전진탐색)

  6. [C+r,ENTER,C+w] 단어찾기 (후진탐색)

  7. [C+x,2] 화면 수평분할

  8. [C+x,o] 다른 화면으로 이동

  9. [C+x,0] 분할된 화면 닫기

  10. [C+x,C+x] 버퍼 목록 보기

  11. [esc,x,dir] 디렉토리 관리 실행

    1. [d] 지울파일선택, [x] 선택파일 지우기, [D] 그냥지우기, [C] 파일복사, [q] 나가기, [v] 파일보기, [Z, y] 파일압축, [!] 셀명령
  12. [esc,x,calendar] 달력보기

    1. [h] 휴일체크, [x] 휴일표시
  13. [C+x,m] 메일작성기실행

    1. [C+c,C+c] 작성된 메일 발송

    2. [C+c,C+s] 메일 버퍼에 기록후 발송

  14. [esc,x,browse-url] 입력받은 url 을 디폴트 브라우저로 실행

  15. [esc,x,text-mode] text-mode 실행

설정

ruby-mode

http://svn.ruby-lang.org/repos/ruby/trunk/misc/

여기에 있는 파일들을 내려받아서 /opt/local/share/emacs/22.0.50/site-lisp 디렉터리에 때려 넣는다.

  1. (autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files" t)
  2. (setq auto-mode-alist (append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
  3. (setq interpreter-mode-alist (append '(("ruby" . ruby-mode)) interpreter-mode-alist))
  4. (autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process")
  5. (autoload 'inf-ruby-keys "inf-ruby" "Set local key defs for inf-ruby in ruby-mode")
  6. (add-hook 'ruby-mode-hook '(lambda () (inf-ruby-keys)))

http://dima-exe.ru/rails-on-emacs

(22.x 버젼 이상에서 동작한다) 따라서 macport 로 emacs 를 설치하는 경우 port install emacs-devel 을 설치한다.

위 내용을 참조해서 emac-rails 관련 설정을 하고 , 파일을 내려받는다.

.emacs 파일에 다음과 같이 추가한다.

  1. (setq load-path (cons "~/.emacs.d/emacs-rails" load-path))
  2. (require 'rails)

마지막으로 rails 모드에서 필요한 라이브러리를 다운로드 받는다. 위치는 site-lisp 폴더에다가...

  1. http://www.kazmier.com/computer/snippet.el
  2. http://www.webweavertech.com/ovidiu/emacs/find-recursive.txt
  3. (당연히 확장자는 el 로 변환해준다)

나이누님의 이맥스 페이지

기타

For use with Internet Explorer -- http://www.gnu.org/software/emacs/windows/faq3.html

You can use Emacs as the editor for composing mail for mailto: links, reading news for news: links, and editing HTML files in Internet Explorer. You first need to install the gnuserv utilities above,
and then modify or create the following registry entries using regedit:
Mail
Key: HKEY_CLASSES_ROOT\mailto\shell\open\command(Default)
Value: gnudoit -q (message-mail (substring \"%1\" 7))

News
Key: HKEY_CLASSES_ROOT\news\shell\open\command(Default)
Value: gnudoit -q (gnus-fetch-group (substring \"%1\" 5))

 
Edit HTML
Key: HKEY_CLASSES_ROOT\htmlfile\shell\edit\command(Default)
Value: gnuclientw %1
기본값 : "C:\Program Files\Microsoft Office\OFFICE11\msohtmed.exe" %1
Recent Updates
    All Pages
      Show/Hide the left navigation
      Show/Hide bookmarks

      Header

      1. View current page

        재선아빠님의 노트

      loginBar