2009년 11월 13일 금요일

.emacs

백업을 위해, 현재 사용하고 있는 .emacs 파일을 남겨둔다.

(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.
 '(TeX-PDF-mode t)
 '(current-language-environment "UTF-8")
 '(default-input-method "korean-hangul3f")
 '(default-korean-keyboard "3f" t)
 '(show-paren-mode t)
 '(transient-mark-mode t))
(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.
(set-background-color "#242424")
(set-foreground-color "#f6f3e8")
(set-cursor-color "#656565")
(set-face-foreground 'font-lock-comment-face "#99968b")
(set-face-italic-p 'font-lock-comment-face t)
(set-face-foreground 'font-lock-doc-face "#99968b")
(set-face-italic-p 'font-lock-doc-face t)
(set-face-foreground 'font-lock-constant-face "#e5786d")
(set-face-foreground 'font-lock-string-face "#95e454")
(set-face-italic-p 'font-lock-string-face t)
(set-face-foreground 'font-lock-variable-name-face "#cae682")
(set-face-foreground 'font-lock-function-name-face "#cae682")
(set-face-foreground 'font-lock-type-face "#cae682")
(set-face-foreground 'font-lock-builtin-face "#8ac6f2")
(set-face-foreground 'font-lock-keyword-face "#8ac6f2")
(set-face-foreground 'font-lock-preprocessor-face "#e5786d")
(set-face-foreground 'font-lock-negation-char-face "#e7f6da")
(set-face-foreground 'link "#8ac6f2")
(set-face-bold-p 'link t)
(set-face-underline-p 'link t)
(set-face-foreground 'show-paren-match "#f6f3e8")
(set-face-background 'show-paren-match "#857b6f")
(set-face-bold-p 'show-paren-match t)
(set-face-foreground 'region "#f6f3e8")
(set-face-background 'region "#444444")
(set-face-foreground 'lazy-highlight "black")
(set-face-background 'lazy-highlight "yellow")
 )

;(register-input-method
; "korean-hangul3f" "Korean" 'quail-use-package
; "한3" "한글 3벌식 최종: Hangul input method"
; "quail/hangul3f")

;; 세벌식 최종
(custom-set-variables
'(default-input-method "korean-hangul3f"))

;; AucTeX
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)

;; Clean Emacs
(setq make-backup-files nil)
(setq inhibit-startup-message t)

;; Hangul Input
(global-set-key [?\S- ] 'toggle-input-method)

;; no beep
(setq visible-bell t)

;; go to the line
(global-set-key [(f5)] 'goto-line);

;; fontset
;(set-default-font "-misc-droid sans mono-medium-r-normal--12-0-0-0-m-0-iso8859-1")
;(set-fontset-font "fontset-default" 'korean-ksc5601 "-microsoft-gulim-medium-r-normal--12-0-0-0-p-0-ksc5601.1987-0")
(set-default-font "Droid Sans Mono-10")
(set-fontset-font "fontset-default" 'korean-ksc5601 "Gulim-10")

;; header identification
;; c, c++, objective c 소스 파일이 있느냐에 따라 헤더의 mode를 결정
(defun my-header-file-mode-hook ()
  (if (string-equal (file-name-extension buffer-file-name) "h")
      (let ((filebase (file-name-sans-extension buffer-file-name)))
        (cond
         ((file-exists-p (concat filebase ".m"))
          (objc-mode)
          )
         ((file-exists-p (concat filebase ".c"))
          (c-mode)
          )
         ((file-exists-p (concat filebase ".cpp"))
          (c++-mode)
          )
         ((file-exists-p (concat filebase ".cc"))
          (c++-mode)
          )
         ((file-exists-p (concat filebase ".mm"))
          (objc-mode)
          )
         (t
          (objc-mode)
          )
         )
        )
    )
  )
(add-hook 'find-file-hook 'my-header-file-mode-hook)

;; compile
(global-set-key [(f7)] 'compile)
(setq compilation-window-height 12)

;; 컴파일 창 자동으로 사라지도록 하는 것
;(setq compilation-finish-function
;      (lambda (buf str)
;    (if (string-match "exited abnormally" str)
;        ;;there were errors
;           (message "compilation errors, press C-x ` to visit")
;      ;;no errors, make the compilation window go away in 0.5 seconds
;         (run-at-time 15 nil 'delete-windows-on buf)
 ;        (message "NO COMPILATION ERRORS!"))))

;; go lang
(setq load-path (cons (expand-file-name "~/go/misc/emacs/") load-path))
(load-library "go-mode")
(setq auto-mode-alist (cons '("\.go$" . go-mode) auto-mode-alist))