]> gitweb @ CieloNegro.org - sugar.git/blob - dot-files/_emacs_el
Auto commit by The Sugar System.
[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 (when window-system
46   (set-default-font "Bitstream Vera Sans Mono 11")
47   (set-fontset-font (frame-parameter nil 'font)
48                     'japanese-jisx0208
49                     '("Hiragino Kaku Gothic Pro W3" . "unicode-bmp")))
50
51 ;; Hooks for newline-and-indent ------------------------------------------------
52 (mapcar (lambda (hook)
53           (add-hook hook
54                     (lambda ()
55                       (local-set-key "\C-m" 'newline-and-indent)
56                       (local-set-key "\C-j" 'newline)
57                       )))
58         '(perl-mode-hook
59           cperl-mode-hook
60           java-mode-hook
61           javascript-mode-hook
62           c-mode-hook
63           c++-mode-hook
64           objc-mode-hook
65           emacs-lisp-mode-hook
66           lisp-mode-hook
67           yatex-mode-hook
68           css-mode-hook
69           scheme-mode-hook))
70
71 ;; Setting for Packages --------------------------------------------------------
72 (defun require-if-present (feature)
73   (condition-case e
74       (require feature)
75     (file-error
76      (if (equal (cadr e) "Cannot open load file")
77          (message "Warning: feature %s is absent" feature) ; warn and ignore
78        (apply 'signal (car e) (cdr e)))))) ; rethrow
79
80 (defun load-if-present (file)
81   (condition-case e
82       (load file)
83     (file-error
84      (if (equal (cadr e) "Cannot open load file")
85          (message "Warning: file named %s is absent" file) ; warn and ignore
86        (apply 'signal (car e) (cdr e)))))) ; rethrow
87
88 (defun load-file-if-present (path)
89   (if (file-exists-p path)
90       (load-file path)
91     (message "Warning: file %s is absent" path)))
92
93 ;; flyspell
94 (require-if-present 'flyspell)
95
96 ;; jaspace
97 (require-if-present 'jaspace)
98
99 ;; mic-paren
100 (require-if-present 'mic-paren)
101 (if (featurep 'mic-paren)
102         (paren-activate))
103
104 ;; elscreen
105 (load "elscreen" "ElScreen" t)
106 (require-if-present 'elscreen-w3m)
107
108 ;; MPC
109 ;(require-if-present 'mpc-autoloads)
110
111 ;; rst-mode
112 (autoload 'rst-mode "rst"
113   "mode for editing reStructuredText documents" t)
114 (setq auto-mode-alist
115       (append '(("\\.rst$" . rst-mode)
116                 ("\\.rest$" . rst-mode)) auto-mode-alist))
117
118 ;; twittering-mode
119 (require-if-present 'twittering-mode)
120 (setq twittering-username "phonohawk")
121
122 ;; cedet
123 (load-file-if-present "/usr/pkg/share/emacs/site-lisp/cedet/common/cedet.el")
124
125 ;; riece
126 (autoload 'riece "riece" "Start Riece" t)
127 (add-hook 'riece-after-load-startup-hook
128                   #'(lambda ()
129                           (add-to-list 'riece-addons 'riece-alias)
130                           (add-to-list 'riece-addons 'riece-skk-kakutei)
131                           (add-to-list 'riece-addons 'riece-keyword)
132                           (add-to-list 'riece-addons 'riece-ctlseq)))
133
134 ;; ecb
135 (require-if-present 'ecb-autoloads)
136 (let* ((hosts '(("netbsd." .
137                  (("~/sandbox/yxmimeproc" "yxmimeproc")
138                   ("~/sandbox/YxMIME" "YxMIME.pm")
139                   ))
140                 ("g1.cuenote.jp" .
141                  (("~/sandbox/MR/engine/libycom" "libycom")
142                   ))
143                 ("aria.cielonegro.org" .
144                  (("~/sandbox/_web-app/Rakka"           "Rakka")
145                   ("~/sandbox/_haskell/Lucu"            "Lucu")
146                   ("~/sandbox/_web-app/Kirschbaum"      "Kirschbaum")
147                   ("~/sandbox/_haskell/HsOpenSSL"       "HsOpenSSL")
148                   ("~/sandbox/_haskell/HsHyperEstraier" "HsHyperEstraier")
149                   ("~/sandbox/_haskell/HsSVN"           "HsSVN")
150                   ("~/sandbox/_game/RoRo"               "RoRo")
151                   ("~/sandbox/_haskell/HXT"             "HXT")
152                   ("~/sandbox/_haskell/hxt-compile"     "hxt-compile")
153                   ("~/src/ghc-6.10.1"                   "ghc-6.10.1")
154                   ("~/sandbox/sugar"                    "sugar")
155                   ("~/sandbox/_haskell/dns"             "dns")
156                   ("~/sandbox/_haskell/blackboard-ddns" "blackboard-ddns")
157                   ))))
158        (paths (cdr (assoc (system-name) hosts))))
159   (setq ecb-source-path paths))
160
161 ;; leim
162 (require-if-present 'gaelic)
163
164 ;; rnc-mode
165 (autoload 'rnc-mode "rnc-mode")
166 (add-to-list 'auto-mode-alist '("\\.rnc\\'" . rnc-mode))
167
168 ;; bookmark
169 (setq bookmark-sort-flag nil)
170
171 ;; sudoku
172 (autoload 'sudoku "sudoku" "The Sudoku" t)
173
174 ;; mew
175 (autoload 'mew "mew" "Mew" t)
176
177 ;; cleite
178 (autoload 'cleite "cleite" "Cleite RSS Aggregator -- Emacs Interface" t)
179
180 ;; javascript
181 (autoload 'js2-mode "js2" nil t)
182 (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
183
184 ;; ido
185 (require 'ido)
186 (ido-mode t)
187
188 ;; sokoban
189 (autoload 'sokoban "sokoban.el" "Start a new game of Sokoban." t)
190 (autoload 'sokoban-mode "sokoban.el" "Play Sokoban in current buffer." t)
191 (setq sokoban-playerfiles-dir "/usr/local/var/games/emacs-sokoban")
192
193 ;; nXML
194 (load-file-if-present "/usr/pkg/share/emacs/site-lisp/nxml-mode/rng-auto.el")
195 (defalias 'xml-mode 'nxml-mode)
196 (add-to-list 'auto-mode-alist '("\\.xml$" . nxml-mode))
197 (add-to-list 'auto-mode-alist '("\\.xi$" . nxml-mode))
198 (add-to-list 'auto-mode-alist '("\\.rdf$" . nxml-mode))
199 (add-to-list 'auto-mode-alist '("\\.rng$" . nxml-mode))
200
201 ;; sstp
202 (autoload 'sstp-mode "sstp" "SSTP Editing Major-Mode" t)
203
204 ;; ruby-mode
205 (autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files")
206 (setq auto-mode-alist
207       (append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
208 (setq interpreter-mode-alist (append '(("ruby" .ruby-mode))
209                                      interpreter-mode-alist))
210 (autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process")
211 (autoload 'inf-ruby-keys "inf-ruby" "set local key defs for inf-ruby in ruby-mode")
212 (add-hook 'ruby-mode-hook
213           '(lambda ()
214             (inf-ruby-keys)
215           ))
216
217 ;; Tramp
218 (setq tramp-default-method "ssh")
219
220 ;; Haskell
221 (load-if-present "haskell-site-file.el")
222
223 (autoload 'run-haskell "inf-haskell" "" t)
224 (autoload 'switch-to-haskell "inf-haskell" "" t)
225 (autoload 'inferior-haskell-load-file "inf-haskell" "" t)
226 (autoload 'inferior-haskell-type "inf-haskell" "" t)
227 (autoload 'inferior-haskell-info "inf-haskell" "" t)
228 (autoload 'inferior-haskell-find-definition "inf-haskell" "" t)
229 (autoload 'inferior-haskell-find-haddock "inf-haskell" "" t)
230
231
232 (add-to-list 'auto-mode-alist '("\\.hs$" . haskell-mode))
233 (add-to-list 'auto-mode-alist '("\\.hsc$" . haskell-mode))
234
235 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
236 (add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
237 (add-hook 'haskell-mode-hook 'turn-on-haskell-ghci)
238
239 ;; Hoogle
240 (autoload 'hoogle-lookup "hoogle" "Hoogle" t)
241 (global-set-key (kbd "C-c h") 'hoogle-lookup)
242
243 ;; c-mode
244 (mapcar (lambda (hook)
245           (add-hook hook
246                     (lambda () (c-set-style "user"))))
247         '(c-mode-hook
248           c++-mode-hook
249           objc-mode-hook
250           java-mode-hook))
251
252 ;; css
253 (autoload 'css-mode "css-mode" "For editing CSS file" t)
254 (setq cssm-indent-level 4)
255 (setq cssm-mirror-mode nil)
256 (setq cssm-indent-function 'cssm-c-style-indenter)
257 (setq auto-mode-alist
258       (append
259        '(("\\.css$" . css-mode))
260        auto-mode-alist))
261
262 ;; EmacsWiki
263 (autoload 'emacs-wiki-find-file "emacs-wiki" "Emacs Wiki" t)
264 (defalias 'wiki 'emacs-wiki-find-file)
265
266 ;; cperl
267 (defalias 'perl-mode 'cperl-mode)
268 (setq cperl-indent-level 4)
269 (setq cperl-indent-parens-as-block t)
270
271 ;; Erlang
272 (add-to-list 'load-path "/usr/pkg/lib/erlang/lib/tools-2.6/emacs")
273 (require-if-present 'erlang-start)
274
275 ;; SKK
276 (require 'skk-autoloads)
277 (global-set-key "\C-x\C-j" 'skk-mode)
278 (global-set-key "\C-xj" 'skk-auto-fill-mode)
279 (global-set-key "\C-xt" 'skk-tutorial)
280 (setq skk-use-jisx0201-input-method t)
281 (setq skk-rom-kana-rule-list
282       '(("@" nil "@")
283         ("wi" nil ("ヰ" . "ゐ"))
284         ("we" nil ("ヱ" . "ゑ"))
285         ;;("hh" "h" ("ン" . "ん"))
286         ;;("mm" "m" ("ン" . "ん"))
287         ("zx" nil ("ゝ" . "ヽ"))
288         ("zc" nil ("ゞ" . "ヾ"))))
289 (set-input-method 'japanese-skk) ; INPUT METHOD
290
291 ;; navi2ch
292 (autoload 'navi2ch "navi2ch" "Navigator for 2ch for Emacs" t)
293
294 ;; migemo
295 (require-if-present 'migemo)
296
297 ;; tiarra-conf
298 (setq load-path (cons (expand-file-name "~/sandbox/Tiarra") load-path))
299 (autoload 'tiarra-conf-mode "tiarra-conf" "tiarra.conf editing mode" t)
300
301 ;; po-mode
302 (autoload 'po-mode "po-mode")
303 (setq auto-mode-alist
304       (cons '("\\.po[tx]?\\'\\|\\.po\\." . po-mode)
305             auto-mode-alist))
306
307 ;; ChangeLog
308 (setq user-full-name "PHO")
309 (setq user-mail-address "pho@cielonegro.org")
310
311 (defun memo ()
312   (interactive)
313   (add-change-log-entry nil (expand-file-name "~/sync/memo.txt")))
314 (define-key ctl-x-map "M" #'memo)
315
316 (defun depression ()
317   (interactive)
318   (add-change-log-entry nil (expand-file-name "~/sync/depression.txt")))
319 (define-key ctl-x-map "P" #'depression)
320
321 (defun plant ()
322   (interactive)
323   (add-change-log-entry nil (expand-file-name "~/sync/plant.txt")))
324 (define-key ctl-x-map "G" #'plant)
325
326 ;; Emacs Calc
327 (add-hook 'calc-start-hook
328           (lambda ()
329             (if (functionp 'paren-deactivate)
330                 (paren-deactivate))))
331 (add-hook 'calc-end-hook
332           (lambda ()
333             (if (functionp 'paren-activate)
334                 (paren-activate))))
335
336 ;;; emacs-w3m
337 (autoload 'w3m "w3m" "Interface for w3m on Emacs." t)
338 (autoload 'w3m-browse-url "w3m" "Browse url by w3m." t)
339 (autoload 'w3m-find-file "w3m" "w3m interface function for local file." t)
340 (autoload 'w3m-search "w3m-search" "Search QUERY using SEARCH-ENGINE." t)
341 (autoload 'w3m-weather "w3m-weather" "Display weather report." t)
342 (autoload 'w3m-antenna "w3m-antenna" "Report chenge of WEB sites." t)
343 (autoload 'w3m-namazu "w3m-namazu" "Search files with Namazu." t)
344
345 ;; pov-mode
346 (autoload 'pov-mode "pov-mode" "POV-Ray scene file mode" t)
347 (setq auto-mode-alist
348       (append '(("\\.pov$" . pov-mode)
349                 ("\\.inc$" . pov-mode)
350                 ) auto-mode-alist))
351
352 ;; End of user configuration ---------------------------------------------------
353
354 ;; emacs auto edit
355 (put 'narrow-to-region 'disabled nil)
356 (custom-set-variables
357   ;; custom-set-variables was added by Custom.
358   ;; If you edit it by hand, you could mess it up, so be careful.
359   ;; Your init file should contain only one such instance.
360   ;; If there is more than one, they won't work right.
361  '(Info-additional-directory-list (quote ("/sw/share/info" "/usr/local/info" "/usr/local/share/info")))
362  '(appt-display-format (quote window))
363  '(appt-message-warning-time 20)
364  '(canlock-password "a14fa4d2601465d55585c291fa8b3943e189e716")
365  '(cleite:auto-refresh-interval nil)
366  '(cleite:measure-srpc-call-time t)
367  '(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")))
368  '(cperl-merge-trailing-else nil)
369  '(default-frame-alist (quote ((tool-bar-lines . 0) (menu-bar-lines . 1) (width . 80) (height . 25) (right-fringe) (left-fringe))))
370  '(ecb-add-path-for-not-matching-files (quote (t)))
371  '(ecb-help-info-path "/sw/share/info/ecb.info")
372  '(ecb-layout-name "left14")
373  '(ecb-options-version "2.32")
374  '(ecb-show-sources-in-directories-buffer (quote always))
375  '(ecb-tip-of-the-day nil)
376  '(ecb-tree-buffer-style (quote ascii-guides))
377  '(ecb-windows-width 0.2)
378  '(elscreen-display-tab t)
379  '(haskell-program-name "ghci")
380  '(ido-enable-flex-matching t)
381  '(ido-everywhere t)
382  '(ido-ignore-files (quote ("\\`CVS/" "\\`#" "\\`.#" "\\`\\.\\./" "\\`\\./" "\\.ttc")))
383  '(ido-work-directory-list-ignore-regexps (quote ("^\\(/mnt/ibm/\\|/Volumes/IBM80GB/\\)")))
384  '(indent-tabs-mode nil)
385  '(jabber-nickname "PHO")
386  '(jabber-resource "emacs")
387  '(jabber-server "jabber.jp")
388  '(jabber-username "phonohawk")
389  '(jaspace-highlight-tabs t)
390  '(js2-basic-offset 4)
391  '(js2-indent-on-enter-key t)
392  '(js2-use-font-lock-faces t)
393  '(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))))
394  '(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")))))
395  '(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")))
396  '(mew-spam: "X-Text-Classification:")
397  '(mew-summary-form (quote (type (5 date) " " (14 from) " " t (14 x-classification) " " (30 subj) "|" (0 body))))
398  '(mouse-wheel-progessive-speed nil)
399  '(mouse-wheel-scroll-amount (quote (1 ((shift) . 5) ((control)))))
400  '(navi2ch-browse-url-browser-function (quote browse-url-firefox))
401  '(navi2ch-display-splash-screen nil)
402  '(navi2ch-list-moved-board-alist (quote (("http://mamono.2ch.net/ihou/" . "http://hideyoshi.2ch.net/ihou/"))))
403  '(navi2ch-mona-face-variable (quote navi2ch-mona16-face))
404  '(navi2ch-mona-on-message-mode t)
405  '(newsticker-html-renderer (quote w3m-region))
406  '(newsticker-url-list nil)
407  '(newsticker-url-list-defaults (quote (("slashdot" "http://slashdot.org/index.rss" nil 3600))))
408  '(nxml-auto-insert-xml-declaration-flag t)
409  '(nxml-slash-auto-complete-flag t)
410  '(riece-layout "default")
411  '(riece-layout-alist (quote (("middle-right" riece-configure-windows right middle) ("middle-left" riece-configure-windows left middle) ("top-right" riece-configure-windows right top) ("top-left" riece-configure-windows left top) ("bottom-right" riece-configure-windows right bottom) ("bottom-left" riece-configure-windows left bottom) ("top" riece-configure-windows-top) ("spiral" riece-configure-windows-spiral) ("default" . "middle-right"))))
412  '(riece-others-buffer-mode nil)
413  '(rng-schema-locating-files (quote ("schemas.xml" "/sw/share/schema/schemas.xml" "~/share/nxml/schemas.xml")))
414  '(safe-local-variable-values (quote ((todo-categories "Todo" "Todo" "Todo" "Todo"))))
415  '(w3m-bookmark-file-coding-system (quote utf-8))
416  '(w3m-coding-system (quote utf-8))
417  '(w3m-coding-system-priority-list (quote (utf-8)))
418  '(w3m-default-coding-system (quote utf-8))
419  '(w3m-default-display-inline-images t)
420  '(w3m-file-coding-system (quote utf-8))
421  '(w3m-file-name-coding-system (quote utf-8))
422  '(w3m-fill-column 80)
423  '(w3m-input-coding-system (quote utf-8))
424  '(w3m-key-binding nil)
425  '(w3m-output-coding-system (quote utf-8))
426  '(w3m-terminal-coding-system (quote utf-8))
427  '(w3m-use-cookies t)
428  '(x-select-enable-clipboard t))
429 (custom-set-faces
430   ;; custom-set-faces was added by Custom.
431   ;; If you edit it by hand, you could mess it up, so be careful.
432   ;; Your init file should contain only one such instance.
433   ;; If there is more than one, they won't work right.
434  '(flyspell-incorrect ((t (:foreground "OrangeRed" :overline t))))
435  '(jaspace-highlight-tab-face ((((class color) (background dark)) (:foreground "gray70" :underline t))))
436  '(which-func-face ((t (:background "black" :foreground "dark orange")))))