-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.el
99 lines (91 loc) · 3.69 KB
/
init.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
;; -*- coding: utf-8 -*-
(progn
;; Emacs の種類/バージョンを判別するための変数を定義
;; @see http://github.com/elim/dotemacs/blob/master/init.el
;; @see http://www.gfd-dennou.org/member/uwabami/cc-env/EmacsBasic.html
(defun x->bool (elt) (not (not elt)))
(defvar emacs22-p (equal emacs-major-version 22))
(defvar emacs23-p (equal emacs-major-version 23))
(defvar darwin-p (eq system-type 'darwin))
(defvar ns-p (featurep 'ns))
(defvar carbon-p (and (eq window-system 'mac) emacs22-p))
(defvar mac-p (and (eq window-system 'mac) emacs23-p))
(defvar linux-p (eq system-type 'gnu/linux))
(defvar colinux-p (when linux-p
(let ((file "/proc/modules"))
(and
(file-readable-p file)
(x->bool
(with-temp-buffer
(insert-file-contents file)
(goto-char (point-min))
(re-search-forward "^cofuse\.+" nil t)))))))
(defvar cygwin-p (eq system-type 'cygwin))
(defvar nt-p (eq system-type 'windows-nt))
(defvar meadow-p (featurep 'meadow))
(defvar windows-p (or cygwin-p nt-p meadow-p))
)
(progn
;; 言語・文字コードの設定
;; @see http://www.gfd-dennou.org/member/uwabami/cc-env/EmacsBasic.htmlw
(set-language-environment "Japanese")
(set-language-environment-coding-systems "Japanese")
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(cond
(mac-p ; local variables
;; Mac OS X の HFS+ ファイルフォーマットではファイル名は NFD (の様な
;; 物)で扱う. 以下はファイル名を NFC で扱う環境と共同作業等する場合の
;; 対処
(require 'ucs-normalize)
(setq file-name-coding-system 'utf-8-hfs)
(setq default-file-name-coding-system 'utf-8-hfs)
(setq local-coding-system 'utf-8-hfs))
(windows-p ; local variables
;; Windows 用の設定
(setq file-name-coding-system 'sjis-dos)
(setq default-file-name-coding-system 'sjis-dos)
(setq local-coding-system 'utf-8))
(t
;; default の設定.
(setq file-name-coding-system 'utf-8)
(setq default-file-name-coding-system 'utf-8)
(setq local-coding-system 'euc-japan)))
)
;;; 実行パスの設定
(defun add-path (dir)
(when (and (file-exists-p dir) (not (member dir exec-path)))
(setenv "PATH" (concat dir ":" (getenv "PATH")))
(setq exec-path (append (list dir) exec-path))))
(add-path (expand-file-name "~/.emacs.d/bin"))
(add-path (expand-file-name "~/lcl/bin"))
(add-path (expand-file-name "~/.opam/current/bin"))
(setenv "LD_LIBRARY_PATH" (concat (expand-file-name "~/lcl/lib") ":"
(expand-file-name "~/local/lib") ":"
(getenv "LD_LIBRARY_PATH")))
;; load-path の設定
(add-to-list 'load-path "~/.emacs.d/elisp")
;; elファイルのコンパイル時にエラーがでるので,その対処
(setq warning-suppress-types nil)
(progn
(require 'cask "~/.cask/cask.el")
(cask-initialize))
(progn
(require 'init-loader)
;; オブション"--debug-init"が指定された場合にはログバッファを表示
;; それ以外は,エラーが発生したらログバッファを表示
(setq init-loader-show-log-after-init debug-on-error)
(add-hook 'after-init-hook
'(lambda ()
(when (not (eql (init-loader-error-log) ""))
(init-loader-show-log))))
(init-loader-load))
;; サーバーの起動
(progn
(require 'server)
(unless (server-running-p)
(server-start))
)