레이블이 emacs인 게시물을 표시합니다. 모든 게시물 표시
레이블이 emacs인 게시물을 표시합니다. 모든 게시물 표시

2013년 7월 16일 화요일

emacs + python에서 auto indent

(add-hook 'python-mode-hook '(lambda () (define-key python-mode-map "\C-m" 'newline-and-indent)))

emacs python할때 현재 폴더에 있는 모듈을 불러오지 못할때.

http://stackoverflow.com/questions/2658475/python-mode-import-problem

.emace.d/init.el에

(defun python-reinstate-current-directory ()
  "When running Python, add the current directory ('') to the head of sys.path.
For reasons unexplained, run-python passes arguments to the
interpreter that explicitly remove '' from sys.path. This means
that, for example, using `python-send-buffer' in a buffer
visiting a module's code will fail to find other modules in the
same directory.

Adding this function to `inferior-python-mode-hook' reinstates
the current directory in Python's search path."
  (python-send-string "sys.path[0:0] = ['']"))

(add-hook 'inferior-python-mode-hook 'python-reinstate-current-directory)

위와 같이 추가

2013년 3월 27일 수요일

emacs 콘솔과 그래픽모드 따른 폰트 적용


;; 프레임에 따라서 폰트 적용이 필요해서 이렇게 했음.
(defun my-frame-config (frame)
  "Custom behaviours for new frames."
  (with-selected-frame frame
    (when (display-graphic-p)
      (let ((fontset "fontset-default"))
        (set-fontset-font fontset 'hangul
                          '("NanumGothicOTF" . "unicode-bmp"))
        (set-face-attribute 'default nil
                            :font fontset
                            :height 160)))))

;; run now
(my-frame-config (selected-frame))
;; and later
(add-hook 'after-make-frame-functions 'my-frame-config)

2013년 2월 8일 금요일

2013년 2월 6일 수요일

2013년 1월 31일 목요일

2012년 3월 1일 목요일

emacs 2.4 설치

sudo add-apt-repository ppa:cassou/emacs
sudo apt-get update
sudo apt-get install emacs-snapshot

mkdir ~/.emacs.d/
cd ~/.emacs.d

emacs init.el
(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)

재시작후
M-x package-refresh-contents
M-x package-install RET starter-kit RET

2012년 2월 29일 수요일

emacs init


(setq inferior-lisp-program "/usr/bin/sbcl")
(add-to-list 'load-path "/home/jaejin/.emacs.d/slime/")
(add-to-list 'load-path "/home/jaejin/.emacs.d")
(require 'slime)

(slime-setup)

(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)

;; python flymake
  (when (load "flymake" t)
         (defun flymake-pyflakes-init ()
           (let* ((temp-file (flymake-init-create-temp-buffer-copy
                              'flymake-create-temp-inplace))
              (local-file (file-relative-name
                           temp-file
                           (file-name-directory buffer-file-name))))
             (list "pyflakes" (list local-file))))

         (add-to-list 'flymake-allowed-file-name-masks
                  '("\\.py\\'" flymake-pyflakes-init)))

(add-hook 'find-file-hook 'flymake-find-file-hook)

;;
(load "erlang_appwiz" t nil)

(require 'erlang-start)
(require 'erlang-eunit)
(require 'erlang-flymake)

(setq auto-mode-alist (cons '("\\.erl$" . erlang-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.hrl$" . erlang-mode) auto-mode-alist))

;; 반투명하게 하기
(defun set-frame-alpha (arg &optional active)
  (interactive "nEnter alpha value (1-100): \np")
  (let* ((elt (assoc 'alpha default-frame-alist))
         (old (frame-parameter nil 'alpha))
         (new (cond ((atom old)     `(,arg ,arg))
                    ((eql 1 active) `(,arg ,(cadr old)))
                    (t              `(,(car old) ,arg)))))
    (if elt (setcdr elt new) (push `(alpha ,@new) default-frame-alist))
    (set-frame-parameter nil 'alpha new)))
(global-set-key (kbd "C-c t") 'set-frame-alpha)

;; This is needed for Distel setup
(let ((distel-dir "/home/jaejin/.emacs.d/distel/elisp"))
  (unless (member distel-dir load-path)
    ;; Add distel-dir to the end of load-path
    (setq load-path (append load-path (list distel-dir)))))

(require 'distel)
(distel-setup)