]> gitweb @ CieloNegro.org - sugar.git/blob - dot-files/_emacs_el
ad328dac61e933a6db4e28902034b0133192835f
[sugar.git] / dot-files / _emacs_el
1 ;; -*- Mode: emacs-lisp; Coding: utf-8 -*-
2
3 ;; Load paths -----------------------------------------------------------------
4 (add-to-list 'load-path (expand-file-name "~/.elisp"))
5 (add-to-list 'load-path "/usr/local/share/emacs/site-lisp")
6
7 ;; Setting for encodings of the environment -----------------------------------
8 (set-language-environment 'Japanese)
9 (set-default-coding-systems 'utf-8)
10 (set-terminal-coding-system 'utf-8)
11 (setq default-file-name-coding-system 'utf-8)
12 (set-keyboard-coding-system 'utf-8)
13 (set-clipboard-coding-system 'utf-8)
14
15 ;; Settings for the Emacs itself ----------------------------------------------
16 (setq truncate-partial-width-windows t)
17 (setq make-backup-files nil)
18
19 (setq read-file-name-completion-ignore-case t)
20 (tool-bar-mode nil)
21
22 (global-set-key "\C-\\" 'toggle-input-method)
23
24 (unless window-system
25   (normal-erase-is-backspace-mode t))
26
27 (setq-default tab-width 4)
28 (global-font-lock-mode t)
29
30 (auto-compression-mode t)
31 (setq visible-bell t)
32 (setq ring-bell-function (lambda ()))
33 (windmove-default-keybindings)
34
35 ;; Settings for Browser --------------------------------------------------------
36 (setq browse-url-browser-function 'w3m-browse-url)
37 (global-set-key "\C-xm" 'browse-url-at-point)
38
39 ;; Setting for the Mode Line ---------------------------------------------------
40 (line-number-mode t)
41 (column-number-mode t)
42 (display-time)
43
44 ;; Setting for Frames ----------------------------------------------------------
45
46 ;; Hooks for newline-and-indent ------------------------------------------------
47 (mapcar (lambda (hook)
48           (add-hook hook
49                     (lambda ()
50                       (local-set-key "\C-m" 'newline-and-indent)
51                       (local-set-key "\C-j" 'newline)
52                       )))
53         '(perl-mode-hook
54           cperl-mode-hook
55           java-mode-hook
56           javascript-mode-hook
57           c-mode-hook
58           c++-mode-hook
59           objc-mode-hook
60           emacs-lisp-mode-hook
61           lisp-mode-hook
62           yatex-mode-hook
63           css-mode-hook
64           scheme-mode-hook))
65
66 ;; Setting for Packages --------------------------------------------------------
67 (defun require-if-present (feature)
68   (condition-case e
69       (require feature)
70     (file-error
71      (if (equal (cadr e) "Cannot open load file")
72          nil ; ignore
73        (apply 'signal (car e) (cdr e)))))) ; rethrow
74
75 (defun load-file-if-present (path)
76   (if (file-exists-p path)
77       (load-file path)))
78
79 ;; flyspell
80 (require-if-present 'flyspell)
81
82 ;; mic-paren
83 (require-if-present 'mic-paren)
84 (paren-activate)
85
86 ;; elscreen
87 (load "elscreen" "ElScreen" t)
88 (require-if-present 'elscreen-w3m)
89
90 ;; MPC
91 ;(require-if-present 'mpc-autoloads)
92
93 ;; cedet
94 (load-file-if-present "/usr/pkg/share/emacs/site-lisp/cedet/common/cedet.el")
95
96 ;; ecb
97 (require-if-present 'ecb-autoloads)
98 (let* ((hosts '(("netbsd." .
99                  (("~/sandbox/yxmimeproc" "yxmimeproc")
100                   ))
101                 ("aria.cielonegro.org" .
102                  (("~/sandbox/_web-app/Rakka"           "Rakka")
103                   ("~/sandbox/_haskell/Lucu"            "Lucu")
104                   ("~/sandbox/_web-app/Kirschbaum"      "Kirschbaum")
105                   ("~/sandbox/_haskell/HsOpenSSL"       "HsOpenSSL")
106                   ("~/sandbox/_haskell/HsHyperEstraier" "HsHyperEstraier")
107                   ("~/sandbox/_haskell/HsSVN"           "HsSVN")
108                   ("~/sandbox/_game/RoRo"               "RoRo")
109                   ("~/sandbox/_haskell/HXT"             "HXT")
110                   ("~/src/ghc-6.10.1"                   "ghc-6.10.1")
111                   ("~/sandbox/sugar"                    "sugar")
112                   ))))
113        (paths (cdr (assoc (system-name) hosts))))
114   (setq ecb-source-path paths))
115
116 ;; leim
117 (require-if-present 'gaelic)
118
119 ;; rnc-mode
120 (autoload 'rnc-mode "rnc-mode")
121 (add-to-list 'auto-mode-alist '("\\.rnc\\'" . rnc-mode))
122
123 ;; bookmark
124 (setq bookmark-sort-flag nil)
125
126 ;; sudoku
127 (autoload 'sudoku "sudoku" "The Sudoku" t)
128
129 ;; mew
130 (autoload 'mew "mew" "Mew" t)
131
132 ;; cleite
133 (autoload 'cleite "cleite" "Cleite RSS Aggregator -- Emacs Interface" t)
134
135 ;; javascript
136 (autoload 'js2-mode "js2" nil t)
137 (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
138
139 ;; ido
140 (require 'ido)
141 (ido-mode t)
142
143 ;; sokoban
144 (autoload 'sokoban "sokoban.el" "Start a new game of Sokoban." t)
145 (autoload 'sokoban-mode "sokoban.el" "Play Sokoban in current buffer." t)
146 (setq sokoban-playerfiles-dir "/usr/local/var/games/emacs-sokoban")
147
148 ;; nXML
149 (load "/usr/pkg/share/emacs/site-lisp/nxml-mode/rng-auto.el")
150 (defalias 'xml-mode 'nxml-mode)
151 (add-to-list 'auto-mode-alist '("\\.xml$" . nxml-mode))
152 (add-to-list 'auto-mode-alist '("\\.xi$" . nxml-mode))
153 (add-to-list 'auto-mode-alist '("\\.rdf$" . nxml-mode))
154 (add-to-list 'auto-mode-alist '("\\.rng$" . nxml-mode))
155
156 ;; sstp
157 (autoload 'sstp-mode "sstp" "SSTP Editing Major-Mode" t)
158
159 ;; ruby-mode
160 (autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files")
161 (setq auto-mode-alist
162       (append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
163 (setq interpreter-mode-alist (append '(("ruby" .ruby-mode))
164                                      interpreter-mode-alist))
165 (autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process")
166 (autoload 'inf-ruby-keys "inf-ruby" "set local key defs for inf-ruby in ruby-mode")
167 (add-hook 'ruby-mode-hook
168           '(lambda ()
169             (inf-ruby-keys)
170           ))
171
172 ;; Tramp
173 (setq tramp-default-method "ssh")
174
175 ;; Haskell
176 (autoload 'haskell-mode "haskell-mode"
177   "Major mode for editing Haskell scripts." t)
178 (autoload 'literate-haskell-mode "haskell-mode"
179   "Major mode for editing literate Haskell scripts." t)
180
181 (add-to-list 'auto-mode-alist '("\\.hs$" . haskell-mode))
182 (add-to-list 'auto-mode-alist '("\\.hsc$" . haskell-mode))
183
184 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
185 (add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
186 (add-hook 'haskell-mode-hook 'turn-on-haskell-ghci)
187
188 ;; Hoogle
189 (autoload 'hoogle-lookup "hoogle" "Hoogle" t)
190 (global-set-key (kbd "C-c h") 'hoogle-lookup)
191
192 ;; c-mode
193 (mapcar (lambda (hook)
194           (add-hook hook
195                     (lambda () (c-set-style "user"))))
196         '(c-mode-hook
197           c++-mode-hook
198           objc-mode-hook
199           java-mode-hook))
200
201 ;; css
202 (autoload 'css-mode "css-mode" "For editing CSS file" t)
203 (setq cssm-indent-level 4)
204 (setq cssm-mirror-mode nil)
205 (setq cssm-indent-function 'cssm-c-style-indenter)
206 (setq auto-mode-alist
207       (append
208        '(("\\.css$" . css-mode))
209        auto-mode-alist))
210
211 ;; EmacsWiki
212 (autoload 'emacs-wiki-find-file "emacs-wiki" "Emacs Wiki" t)
213 (defalias 'wiki 'emacs-wiki-find-file)
214
215 ;; cperl
216 (defalias 'perl-mode 'cperl-mode)
217 (setq cperl-indent-level 4)
218 (setq cperl-indent-parens-as-block t)
219
220 ;; SKK
221 (require 'skk-autoloads)
222 (global-set-key "\C-x\C-j" 'skk-mode)
223 (global-set-key "\C-xj" 'skk-auto-fill-mode)
224 (global-set-key "\C-xt" 'skk-tutorial)
225 (setq skk-use-jisx0201-input-method t)
226 (setq skk-rom-kana-rule-list
227       '(("@" nil "@")
228         ("wi" nil ("ヰ" . "ゐ"))
229         ("we" nil ("ヱ" . "ゑ"))
230         ;;("hh" "h" ("ン" . "ん"))
231         ;;("mm" "m" ("ン" . "ん"))
232         ("zx" nil ("ゝ" . "ヽ"))
233         ("zc" nil ("ゞ" . "ヾ"))))
234 (set-input-method 'japanese-skk) ; INPUT METHOD
235
236 ;; navi2ch
237 (autoload 'navi2ch "navi2ch" "Navigator for 2ch for Emacs" t)
238
239 ;; migemo
240 (require-if-present 'migemo)
241
242 ;; tiarra-conf
243 (setq load-path (cons (expand-file-name "~/sandbox/Tiarra") load-path))
244 (autoload 'tiarra-conf-mode "tiarra-conf" "tiarra.conf editing mode" t)
245
246 ;; po-mode
247 (autoload 'po-mode "po-mode")
248 (setq auto-mode-alist
249       (cons '("\\.po[tx]?\\'\\|\\.po\\." . po-mode)
250             auto-mode-alist))
251
252 ;; ChangeLog
253 (setq user-full-name "PHO")
254 (setq user-mail-address "pho@cielonegro.org")
255
256 (defun memo ()
257   (interactive)
258   (add-change-log-entry nil (expand-file-name "~/sync/memo.txt")))
259 (define-key ctl-x-map "M" #'memo)
260
261 (defun depression ()
262   (interactive)
263   (add-change-log-entry nil (expand-file-name "~/sync/depression.txt")))
264 (define-key ctl-x-map "P" #'depression)
265
266 (defun plant ()
267   (interactive)
268   (add-change-log-entry nil (expand-file-name "~/sync/plant.txt")))
269 (define-key ctl-x-map "G" #'plant)
270
271 ;; Emacs Calc
272 (add-hook 'calc-start-hook
273           (lambda ()
274             (if (functionp 'paren-deactivate)
275                 (paren-deactivate))))
276 (add-hook 'calc-end-hook
277           (lambda ()
278             (if (functionp 'paren-activate)
279                 (paren-activate))))
280
281 ;;; emacs-w3m
282 (autoload 'w3m "w3m" "Interface for w3m on Emacs." t)
283 (autoload 'w3m-browse-url "w3m" "Browse url by w3m." t)
284 (autoload 'w3m-find-file "w3m" "w3m interface function for local file." t)
285 (autoload 'w3m-search "w3m-search" "Search QUERY using SEARCH-ENGINE." t)
286 (autoload 'w3m-weather "w3m-weather" "Display weather report." t)
287 (autoload 'w3m-antenna "w3m-antenna" "Report chenge of WEB sites." t)
288 (autoload 'w3m-namazu "w3m-namazu" "Search files with Namazu." t)
289
290 ;; pov-mode
291 (autoload 'pov-mode "pov-mode" "POV-Ray scene file mode" t)
292 (setq auto-mode-alist
293       (append '(("\\.pov$" . pov-mode)
294                 ("\\.inc$" . pov-mode)
295                 ) auto-mode-alist))
296
297 ;; End of user configuration ---------------------------------------------------
298
299 ;; emacs auto edit
300 (put 'narrow-to-region 'disabled nil)
301 (custom-set-variables
302   ;; custom-set-variables was added by Custom.
303   ;; If you edit it by hand, you could mess it up, so be careful.
304   ;; Your init file should contain only one such instance.
305   ;; If there is more than one, they won't work right.
306  '(Info-additional-directory-list (quote ("/sw/share/info" "/usr/local/info" "/usr/local/share/info")))
307  '(appt-display-format (quote window))
308  '(appt-message-warning-time 20)
309  '(canlock-password "a14fa4d2601465d55585c291fa8b3943e189e716")
310  '(cleite:auto-refresh-interval nil)
311  '(cleite:measure-srpc-call-time t)
312  '(completion-ignored-extensions (quote (".svn/" "CVS/" ".o" "~" ".bin" ".lbin" ".so" ".a" ".ln" ".blg" ".bbl" ".elc" ".lof" ".glo" ".idx" ".lot" ".dvi" ".fmt" ".tfm" ".pdf" ".class" ".fas" ".lib" ".mem" ".x86f" ".sparcf" ".fasl" ".ufsl" ".fsl" ".dxl" ".pfsl" ".dfsl" ".lo" ".la" ".gmo" ".mo" ".toc" ".aux" ".cp" ".fn" ".ky" ".pg" ".tp" ".vr" ".cps" ".fns" ".kys" ".pgs" ".tps" ".vrs" ".pyc" ".pyo" ".hi")))
313  '(cperl-merge-trailing-else nil)
314  '(default-frame-alist (quote ((tool-bar-lines . 0) (menu-bar-lines . 1) (width . 80) (height . 25) (right-fringe) (left-fringe))))
315  '(ecb-add-path-for-not-matching-files (quote (t)))
316  '(ecb-help-info-path "/sw/share/info/ecb.info")
317  '(ecb-layout-name "left14")
318  '(ecb-options-version "2.32")
319  '(ecb-show-sources-in-directories-buffer (quote always))
320  '(ecb-tip-of-the-day nil)
321  '(ecb-tree-buffer-style (quote ascii-guides))
322  '(ecb-windows-width 0.2)
323  '(elscreen-display-tab t)
324  '(haskell-program-name "ghci")
325  '(ido-enable-flex-matching t)
326  '(ido-everywhere t)
327  '(ido-ignore-files (quote ("\\`CVS/" "\\`#" "\\`.#" "\\`\\.\\./" "\\`\\./" "\\.ttc")))
328  '(ido-work-directory-list-ignore-regexps (quote ("^\\(/mnt/ibm/\\|/Volumes/IBM80GB/\\)")))
329  '(indent-tabs-mode nil)
330  '(jabber-nickname "PHO")
331  '(jabber-resource "emacs")
332  '(jabber-server "jabber.jp")
333  '(jabber-username "phonohawk")
334  '(js2-basic-offset 4)
335  '(js2-indent-on-enter-key t)
336  '(js2-use-font-lock-faces t)
337  '(mew-field-spec (quote (("^Resent-\\(From\\|To\\|Cc\\|Date\\)" t mew-face-header-important mew-face-header-important) ("^Subject:$" t mew-face-header-important mew-face-header-subject) ("^From:$" t mew-face-header-important mew-face-header-from) ("^\\(To\\|Apparently-To\\):$" t mew-face-header-important mew-face-header-to) ("^\\(Cc\\|Dcc\\|Bcc\\):$" t mew-face-header-important mew-face-header-to) ("^Newsgroups:$" t mew-face-header-important mew-face-header-to) ("^Date:$" t mew-face-header-important mew-face-header-date) ("^Reply-To:$" t) ("^X-Mailer:$" t) ("^X-Mew:$" t mew-face-header-important mew-face-header-xmew) ("^\\(Received\\|Return-Path\\|Sender\\|Errors-To\\):$" nil) ("^\\(Path\\|Distribution\\|Xref\\):$" nil) ("^NNTP-Posting-" nil) ("^\\(Message-Id\\|Posted\\|In-Reply-To\\|References\\|Precedence\\):$" nil) ("^Delivered-" nil) ("^List-" nil) ("^\\(Mime-Version\\|Lines\\):$" nil) ("^From$" nil) ("^Status:$" nil) ("^Face:$" nil mew-face-header-private mew-face-header-marginal) ("^X-Text-Classification:$" t mew-face-header-important mew-face-header-important) ("^X-POPFile-Link:$" t mew-face-header-important mew-face-body-url) ("^\\(X\\|Original\\)-" nil mew-face-header-private mew-face-header-marginal))))
338  '(mew-refile-guess-alist (quote (("From:" ("noreply@adc1.apple.com" . "+mm/adc") ("mag2 ID 0000022139" . "+mm/2ch") ("noreply@sourceforge.net" . "+from/sf-net")) ("Subject:" ("w3m-dev" . "+ml/w3m-dev")) ("To:" ("glasgow-haskell-users@haskell.org" . "+ml/ghc-users") ("fink-devel@lists.sourceforge.net" . "+ml/fink-devel")) ("Reply-To:" ("yun@kokonoe.com" . "+mm/kokonoe")) ("Cc:" ("glasgow-haskell-users@haskell.org" . "+ml/ghc-users")))))
339  '(mew-scan-fields (quote ("Folder:" "Filename:" "Subject:" "Date:" "From:" "To:" "Cc:" "Content-Type:" "Content-Transfer-Encoding:" "X-Mew-Uidl:" "Message-Id:" "In-Reply-To:" "References:" "X-Mew-Ref:" "X-Text-Classification:" "Body")))
340  '(mew-spam: "X-Text-Classification:")
341  '(mew-summary-form (quote (type (5 date) " " (14 from) " " t (14 x-classification) " " (30 subj) "|" (0 body))))
342  '(mouse-wheel-progessive-speed nil)
343  '(mouse-wheel-scroll-amount (quote (1 ((shift) . 5) ((control)))))
344  '(navi2ch-browse-url-browser-function (quote browse-url-with-firefox))
345  '(navi2ch-mona-face-variable (quote navi2ch-mona16-face))
346  '(navi2ch-mona-on-message-mode t)
347  '(newsticker-html-renderer (quote w3m-region))
348  '(newsticker-url-list nil)
349  '(newsticker-url-list-defaults (quote (("slashdot" "http://slashdot.org/index.rss" nil 3600))))
350  '(nxml-auto-insert-xml-declaration-flag t)
351  '(nxml-slash-auto-complete-flag t)
352  '(rng-schema-locating-files (quote ("schemas.xml" "/sw/share/schema/schemas.xml" "~/share/nxml/schemas.xml")))
353  '(safe-local-variable-values (quote ((todo-categories "Todo" "Todo" "Todo" "Todo"))))
354  '(w3m-bookmark-file-coding-system (quote utf-8))
355  '(w3m-coding-system (quote utf-8))
356  '(w3m-coding-system-priority-list (quote (utf-8)))
357  '(w3m-default-coding-system (quote utf-8))
358  '(w3m-default-display-inline-images t)
359  '(w3m-file-coding-system (quote utf-8))
360  '(w3m-file-name-coding-system (quote utf-8))
361  '(w3m-fill-column 80)
362  '(w3m-input-coding-system (quote utf-8))
363  '(w3m-key-binding nil)
364  '(w3m-output-coding-system (quote utf-8))
365  '(w3m-terminal-coding-system (quote utf-8))
366  '(w3m-use-cookies t)
367  '(x-select-enable-clipboard t))
368 (custom-set-faces
369   ;; custom-set-faces was added by Custom.
370   ;; If you edit it by hand, you could mess it up, so be careful.
371   ;; Your init file should contain only one such instance.
372   ;; If there is more than one, they won't work right.
373  '(flyspell-incorrect ((t (:foreground "OrangeRed" :overline t))))
374  '(which-func-face ((t (:background "black" :foreground "dark orange")))))