2011-02-05
macでemacs python環境
Carbon Emacsを入れる
.emacsの一般的な設定
参考 http://blog.s2factory.co.jp/yoshizu/2008/05/carbon-emacs.html
;; ロードパス (setq load-path (cons "~/emacs/site-lisp" load-path)) (setq load-path (cons "~/emacs/site-lisp/w3m" load-path)) ;; 行数表示 (line-number-mode t) ;; スタートアップページを表示しない (setq inhibit-startup-message t) ;; バックアップファイルを作らない (setq backup-inhibited t) ;; Macのキーバインドを使う。optionをメタキーにする。 (mac-key-mode 1) (setq mac-option-modifier 'meta) ;; タブキー (setq default-tab-width 4) (setq indent-line-function 'indent-relative-maybe) ;; シフト + 矢印で範囲選択 (setq pc-select-selection-keys-only t) (pc-selection-mode 1) ;; フォント設定 (if (eq window-system 'mac) (require 'carbon-font)) (fixed-width-set-fontset "hirakaku_w3" 12) (setq fixed-width-rescale nil) ;; ウィンドウ設定 (if window-system (progn (setq initial-frame-alist '((width . 110) (height . 60) (top . 50))) (set-background-color "Black") (set-foreground-color "LightGray") (set-cursor-color "Gray") (set-frame-parameter nil 'alpha 80) )) ;; メニューバーを隠す (tool-bar-mode -1)
ターミナルからemcas起動できるようにする
.bashrcの設定
alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs'
.bash_profileの設定
参考 http://memo358.blog18.fc2.com/blog-entry-30.html
if [ -f ~/.bashrc ] ; then . ~/.bashrc fi
pythonの設定
ロードパス作成
mkdir -p ~/emacs/site-lisp mkdir -p ~/emacs/site-lisp/w3m
GAE用にpython2.5のeasy_setupをインストール
sudo port install py25-setuptools
pyhon-modeとauto-completeを取得
ここから、パス確認
https://launchpad.net/python-mode/+download
cd ~/emacs/site-lisp wget http://launchpadlibrarian.net/61970301/python-mode.el wget http://www.emacswiki.org/emacs/download/auto-complete.el
.emacsの設定
;; python-mode (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)) (autoload 'python-mode "python-mode" "Python editing mode." t) ;; auto-complete (require 'auto-complete) (global-auto-complete-mode t)
pysmellの設定
pysmellを入れる
補完候補を作成
sudo easy_install pysmell cd pysmell . cd /opt/local/lib/python2.5/ pysmell . -x site-packages test -o ~/PYSMELLTAGS.stdlib
python-modeでインデントを4つにする
;;python-mode (add-hook 'python-mode-hook '(lambda() (setq indent-tabs-mode t) (setq indent-level 4) (setq python-indent 4) (setq tab-width 4)))
.emacsの設定
;; pysmell (require 'pysmell) (add-hook 'python-mode-hook (lambda () (pysmell-mode 1)))
PIL入れる
参考 http://code.google.com/intl/ja/appengine/docs/python/images/installingPIL.html
sudo port install py25-pil
.emacs
最終的にこうなる
;; ロードパス (setq load-path (cons "~/emacs/site-lisp" load-path)) (setq load-path (cons "~/emacs/site-lisp/w3m" load-path)) ;; 行数表示 (line-number-mode t) ;; スタートアップページを表示しない (setq inhibit-startup-message t) ;; バックアップファイルを作らない (setq backup-inhibited t) ;; Macのキーバインドを使う。optionをメタキーにする。 (mac-key-mode 1) (setq mac-option-modifier 'meta) ;; タブキー (setq default-tab-width 4) (setq indent-line-function 'indent-relative-maybe) ;; シフト + 矢印で範囲選択 (setq pc-select-selection-keys-only t) (pc-selection-mode 1) ;; フォント設定 (if (eq window-system 'mac) (require 'carbon-font)) (fixed-width-set-fontset "hirakaku_w3" 12) (setq fixed-width-rescale nil) ;; ウィンドウ設定 (if window-system (progn (setq initial-frame-alist '((width . 110) (height . 60) (top . 50))) (set-background-color "Black") (set-foreground-color "LightGray") (set-cursor-color "Gray") (set-frame-parameter nil 'alpha 80) )) ;; ウィンドウを透明化 (add-to-list 'default-frame-alist '(alpha . (0.85 0.85))) ;; python-mode (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)) (autoload 'python-mode "python-mode" "Python editing mode." t) ;; auto-complete (require 'auto-complete) (global-auto-complete-mode t) ;; pysmell (require 'pysmell) (add-hook 'python-mode-hook (lambda () (pysmell-mode 1))) ;;python-mode (add-hook 'python-mode-hook '(lambda() (setq indent-tabs-mode t) (setq indent-level 4) (setq python-indent 4) (setq tab-width 4)))
コメントを書く
トラックバック - http://d.hatena.ne.jp/hidecheck/20110205/1296922662
リンク元
- 18 http://pipes.yahoo.com/pipes/pipe.info?_id=tDfBdGWF3RGl9XNm1L3fcQ
- 4 http://www.google.co.jp/search?sourceid=chrome&ie=UTF-8&q=android+アプリ main.xml デザイン+graphical+layout+view+imageview
- 3 http://pipes.yahoo.com/pipes/pipe.info?_id=12e453e301454b799b3ac6642aa089b5
- 3 http://www.google.co.jp/search?q=android+onclick&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
- 2 http://search.yahoo.co.jp/search?p=getSerializableExtra&search.x=1&fr=top_ga1_sa&tid=top_ga1_sa&ei=UTF-8&aq=&oq=
- 2 http://www.google.co.jp/search?aq=f&sourceid=chrome&ie=UTF-8&q=intent.putExtra
- 2 http://www.google.co.jp/search?hl=ja&biw=1305&bih=883&q=android+bitmap+リサイズ&revid=1029377210&sa=X&ei=eShOTezfPIOavgPh58EX&ved=0CCEQ4QIoAg
- 2 http://www.google.co.jp/search?q=android+画面遷移&hl=ja&rlz=1B3GGGL_ja___JP317&prmd=ivns&ei=I5ZNTZDWBIL8vQOooYkx&start=10&sa=N
- 2 http://www.google.com/reader/view/
- 1 http://labs.techfirm.co.jp/android/cho/829