요즘 Emacs 에 푹 빠져 있습니다. 제가 한번 미치면 정신이 없이 빠져 드는 성격이라 ^^ 그래서 emacs 를 이거 저거 건드려 보고 있지만 , 이거참.. 외국 사이트 조차 emacs 에 대한 자료는 없네요 .

그래도 여기저기 두드려 가면서 얻은 지식을 일차적으로 정리할까 생각중입니다. 그중 첫번째인 일단 환경 파일 부터 !!!

; 문자셋 utf-8 쓰기
(require 'cl)
(defun set-my-emacs-coding-system()
"my coding system"
(set-variable 'inferior-lisp-program "/usr/bin/gcl")
(set-language-environment "korean")
(setq-default coding-system 'utf-8)
(setq-default buffer-file-coding-system 'utf-8)
(setq-default buffer-coding-system 'utf-8)
(setq-default file-name-coding-system 'utf-8)
(setq-default senmail-coding-system 'utf-8)
(setq file-coding-system 'utf-8)
(setq sendmail-coding-system 'utf-8)
(setq terminal-coding-system 'utf-8)
(setq shell-coding-system 'utf-8)

; 여기 까지가 emacs 모든 환경에서 utf-8 으로 문자를 인코딩 하게 세팅 해주는 부분입니다.

(setq load-path (cons (expand-file-name "~/.emacs.d/") load-path))
  (require 'etheme)
(etheme-apply-theme "cinsk")
)

; 여기까지는 emacs 에서 구동되는 테마에 관한것 입니다. 아주 이쁘게 보이죠 ^^


(defun set-my-keyboard()
 "my keyboard setup"
(set-input-method "korean-hangul3")
(global-set-key [\S- ] 'toggle-input-method)
)

; 한글 세팅 입니다. 저는 삼벌식 유저라 hangul3 입니다.
; 2벌식 유저는 hangul2 로 세팅하시면 됩니다.
; global 로 시작하는것은 한/영 전환인데 linux 건 , 윈도건 저는 기본이 shift -space 전환이라 있으나 마나한 세팅이더군요 (실제로 작동하지 않는다는 것입니다) 그래서 C-\ 로 변환

(when enable-multibyte-characters
(set-my-emacs-coding-system)
(set-my-keyboard)
)

; 위에 세팅한 함수들을 실행해 주는 부분이라 하겠습니다. 최근에 어떤 기능인지 알았음 ^^

(defun unicode-shell ()
"Execute the shell buffer in UTF-8 encoding.
Note that you'll need to set the environment variable LANG and others
appropriately."
(interactive)
(let ((coding-system-for-read 'utf-8)
(coding-system-for-write 'utf-8)
(coding-system-require-warning t))
(call-interactively 'shell)))

;최근에 무지 고생하면서 알아낸 emacs 에서 shell 모드 사용시 utf - 8 문자열 셋으로 보이게 세팅해 주는 부분입니다.

(unicode-shell)

+ Recent posts