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