-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.emacs
150 lines (129 loc) · 4.57 KB
/
.emacs
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
(add-to-list 'load-path "~/.emacs.d/site-lisp/")
(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.
'(column-number-mode t)
'(fringe-mode (quote (0)) nil (fringe))
'(scroll-bar-mode nil)
'(show-paren-mode t)
'(tool-bar-mode nil)
'(tooltip-mode nil))
(setq backup-by-copying-when-linked t)
(when window-system
;; prepare python environment
(require 'ipython)
(require 'pymacs)
(pymacs-load "ropemacs" "rope-")
(setq ropemacs-enable-autoimport 't))
(when window-system
;; mustache mode
(require 'mustache-mode))
(when window-system
;; load nxhtml
(load "~/.emacs.d/nxhtml/autostart.el")
(setq mumamo-background-colors nil)
(add-to-list 'auto-mode-alist '("\\.html$" . django-html-mumamo-mode))
;; bugfix for particular emacs version
(when (and (equal emacs-major-version 24)
(equal emacs-minor-version 1))
(eval-after-load "bytecomp"
'(add-to-list 'byte-compile-not-obsolete-vars
'font-lock-beginning-of-syntax-function))
(eval-after-load "bytecomp"
'(add-to-list 'byte-compile-not-obsolete-vars
'font-lock-syntactic-keywords))
;; tramp-compat.el clobbers this variable!
(eval-after-load "tramp-compat"
'(add-to-list 'byte-compile-not-obsolete-vars
'font-lock-beginning-of-syntax-function))
(eval-after-load "tramp-compat"
'(add-to-list 'byte-compile-not-obsolete-vars
'font-lock-syntactic-keywords)))
)
(when window-system
;; js2-mode
(autoload 'js2-mode "js2-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
)
;; load color theme
(when window-system
(load-library "color-theme")
(color-theme-initialize)
(color-theme-calm-forest))
;; lisp
(when window-system
(setq inferior-lisp-program "/usr/bin/sbcl")
(require 'slime)
(slime-setup))
(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.
)
(defun flymake-create-temp-intemp (file-name prefix)
"Return file name in temporary directory for checking
FILE-NAME. This is a replacement for
`flymake-create-temp-inplace'. The difference is that it gives
a file name in `temporary-file-directory' instead of the same
directory as FILE-NAME.
For the use of PREFIX see that function.
Note that not making the temporary file in another directory
\(like here) will not if the file you are checking depends on
relative paths to other files \(for the type of checks flymake
makes)."
(unless (stringp file-name)
(error "Invalid file-name"))
(or prefix
(setq prefix "flymake"))
(let* ((name (concat
(file-name-nondirectory
(file-name-sans-extension file-name))
"_" prefix))
(ext (concat "." (file-name-extension file-name)))
(temp-name (make-temp-file name nil ext))
)
(flymake-log 3 "create-temp-intemp: file=%s temp=%s" file-name temp-name)
temp-name))
(setq temporary-file-directory "/tmp/")
(when (load "flymake" t)
(defun flymake-create-relative-temp-file ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
;;'flymake-create-temp-inplace))
'flymake-create-temp-intemp)))
(file-relative-name
temp-file (file-name-directory
buffer-file-name))))
(defun flymake-checker-init (checker-name)
(let* ((local-file (flymake-create-relative-temp-file))
(checker-dir (locate-dominating-file
(concat "./" local-file)
checker-name)))
(if checker-dir
(list (file-truename (concat
checker-dir checker-name))
(list local-file))
())))
(global-set-key (kbd "M-p") 'flymake-goto-prev-error)
(global-set-key (kbd "M-n") 'flymake-goto-next-error)
(defun flymake-python-init ()
(flymake-checker-init "pychecker"))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-python-init))
(defun flymake-js-init ()
(flymake-checker-init "jschecker"))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.js\\'" flymake-js-init))
)
(when window-system
;;(add-hook 'find-file-hook 'flymake-find-file-hook)
(load-library "flymake-cursor")
;; (add-hook 'python-mode-hook 'flymake-find-file-hook)
(add-hook 'python-mode-hook
(lambda ()
(unless (eq buffer-file-name nil) (flymake-mode t))
))
(add-hook 'js2-mode-hook 'flymake-find-file-hook)
)