1 ;; -*- Mode: emacs-lisp; Coding: utf-8 -*-
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")
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)
15 ;; Settings for the Emacs itself ----------------------------------------------
16 (setq truncate-partial-width-windows t)
17 (setq make-backup-files nil)
19 (setq read-file-name-completion-ignore-case t)
22 (global-set-key "\C-\\" 'toggle-input-method)
25 (normal-erase-is-backspace-mode t))
27 (setq-default tab-width 4)
28 (global-font-lock-mode t)
30 (auto-compression-mode t)
32 (setq ring-bell-function (lambda ()))
33 (windmove-default-keybindings)
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"))))
42 ;; Settings for Browser --------------------------------------------------------
43 (setq browse-url-browser-function 'w3m-browse-url)
44 (global-set-key "\C-xm" 'browse-url-at-point)
46 ;; Setting for the Mode Line ---------------------------------------------------
48 (column-number-mode t)
51 ;; Setting for Frames ----------------------------------------------------------
53 (if (equal (system-name) "seras")
54 (set-default-font "Dejavu Sans Mono 11")
55 (set-default-font "Dejavu Sans Mono 13")))
58 ; (set-default-font "Inconsolata-14")
59 ; (set-face-font 'variable-pitch "Inconsolata-14")
60 ; (set-fontset-font (frame-parameter nil 'font)
62 ; '("Takaoゴシック" . "unicode-bmp")))
65 ; (add-to-list 'default-frame-alist
66 ; '(font . "Bitstream Vera Sans Mono 12"))
67 ; (set-frame-font "Bitstream Vera Sans Mono 12")
68 ; (set-fontset-font nil;(frame-parameter nil 'font)
70 ; '("Hiragino Kaku Gothic Pro W3" . "unicode-bmp")))
72 ;; Hooks for newline-and-indent ------------------------------------------------
73 ;(mapcar (lambda (hook)
76 ; (local-set-key "\C-m" 'newline-and-indent)
77 ; (local-set-key "\C-j" 'newline)
82 ; javascript-mode-hook
86 ; emacs-lisp-mode-hook
92 ;; Setting for Packages --------------------------------------------------------
93 (defun require-if-present (feature)
97 (if (equal (cadr e) "Cannot open load file")
98 (message "Warning: feature %s is absent" feature) ; warn and ignore
99 (apply 'signal (car e) (cdr e)))))) ; rethrow
101 (defun load-if-present (file)
105 (if (equal (cadr e) "Cannot open load file")
106 (message "Warning: file named %s is absent" file) ; warn and ignore
107 (apply 'signal (car e) (cdr e)))))) ; rethrow
109 (defun load-file-if-present (path)
110 (if (file-exists-p path)
112 (message "Warning: file %s is absent" path)))
115 (require-if-present 'flyspell)
118 (require-if-present 'jaspace)
121 (require-if-present 'color-theme)
122 (if (featurep 'color-theme)
123 (color-theme-initialize)
124 (color-theme-subtle-hacker))
127 (require-if-present 'auto-complete-config)
128 (if (featurep 'auto-complete-config)
130 (add-to-list 'ac-dictionary-directories
131 "/usr/pkg/share/emacs/site-lisp/auto-complete/ac-dict")
132 (mapcar (lambda (mode)
133 (add-to-list 'ac-modes mode))
136 (setq ac-modes (remove 'css-mode ac-modes))
137 (add-hook 'erlang-mode-hook
139 (add-to-list 'ac-sources 'ac-source-semantic)))
140 (ac-config-default)))
143 (require-if-present 'mic-paren)
144 (if (featurep 'mic-paren)
148 (load "elscreen" "ElScreen" t)
149 (require-if-present 'elscreen-w3m)
152 (require-if-present 'undo-tree)
153 (if (featurep 'undo-tree)
154 (global-undo-tree-mode))
157 ;(require-if-present 'mpc-autoloads)
160 (autoload 'rst-mode "rst"
161 "mode for editing reStructuredText documents" t)
162 (setq auto-mode-alist
163 (append '(("\\.rst$" . rst-mode)
164 ("\\.rest$" . rst-mode)) auto-mode-alist))
167 (autoload 'lua-mode "lua-mode" "Lua editing mode." t)
168 (add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode) auto-mode-alist)
171 (require-if-present 'twittering-mode)
172 (setq twittering-username "phonohawk")
175 (autoload 'riece "riece" "Start Riece" t)
176 (add-hook 'riece-after-load-startup-hook
178 (add-to-list 'riece-addons 'riece-alias)
179 (add-to-list 'riece-addons 'riece-skk-kakutei)
180 (add-to-list 'riece-addons 'riece-keyword)
181 (add-to-list 'riece-addons 'riece-ctlseq)))
184 (require-if-present 'ecb-autoloads)
185 (let* ((hosts '(("netbsd." .
186 (("~/sandbox/yxmimeproc" "yxmimeproc")
187 ("~/sandbox/YxMIME" "YxMIME.pm")
190 (("~/sandbox/MR/engine/libycom" "libycom")
192 ("aria.cielonegro.org" .
193 (("~/sandbox/_web-app/Rakka" "Rakka")
194 ("~/sandbox/_haskell/Lucu" "Lucu")
195 ("~/sandbox/_web-app/Kirschbaum" "Kirschbaum")
196 ("~/sandbox/_haskell/HsOpenSSL" "HsOpenSSL")
197 ("~/sandbox/_haskell/HsHyperEstraier" "HsHyperEstraier")
198 ("~/sandbox/_haskell/HsSVN" "HsSVN")
199 ("~/sandbox/_game/RoRo" "RoRo")
200 ("~/sandbox/_haskell/HXT" "HXT")
201 ("~/sandbox/_haskell/hxt-compile" "hxt-compile")
202 ("~/src/ghc-6.10.1" "ghc-6.10.1")
203 ("~/sandbox/sugar" "sugar")
204 ("~/sandbox/_haskell/dns" "dns")
205 ("~/sandbox/_haskell/blackboard-ddns" "blackboard-ddns")
207 (paths (cdr (assoc (system-name) hosts))))
208 (setq ecb-source-path paths))
211 (require-if-present 'gaelic)
214 (autoload 'rnc-mode "rnc-mode")
215 (add-to-list 'auto-mode-alist '("\\.rnc\\'" . rnc-mode))
218 (setq bookmark-sort-flag nil)
221 (autoload 'sudoku "sudoku" "The Sudoku" t)
224 (autoload 'mew "mew" "Mew" t)
227 (autoload 'cleite "cleite" "Cleite RSS Aggregator -- Emacs Interface" t)
230 (autoload 'js2-mode "js2" nil t)
231 (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
238 (autoload 'sokoban "sokoban.el" "Start a new game of Sokoban." t)
239 (autoload 'sokoban-mode "sokoban.el" "Play Sokoban in current buffer." t)
240 (setq sokoban-playerfiles-dir "/usr/local/var/games/emacs-sokoban")
243 (load-file-if-present "/usr/pkg/share/emacs/site-lisp/nxml-mode/rng-auto.el")
244 (defalias 'xml-mode 'nxml-mode)
245 (add-to-list 'auto-mode-alist '("\\.xml$" . nxml-mode))
246 (add-to-list 'auto-mode-alist '("\\.xi$" . nxml-mode))
247 (add-to-list 'auto-mode-alist '("\\.rdf$" . nxml-mode))
248 (add-to-list 'auto-mode-alist '("\\.rng$" . nxml-mode))
251 (autoload 'sstp-mode "sstp" "SSTP Editing Major-Mode" t)
254 (autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files")
255 (setq auto-mode-alist
256 (append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
257 (setq interpreter-mode-alist (append '(("ruby" .ruby-mode))
258 interpreter-mode-alist))
259 (autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process")
260 (autoload 'inf-ruby-keys "inf-ruby" "set local key defs for inf-ruby in ruby-mode")
261 (add-hook 'ruby-mode-hook
267 (load-if-present "haskell-site-file.el")
269 (autoload 'run-haskell "inf-haskell" "" t)
270 (autoload 'switch-to-haskell "inf-haskell" "" t)
271 (autoload 'inferior-haskell-load-file "inf-haskell" "" t)
272 (autoload 'inferior-haskell-type "inf-haskell" "" t)
273 (autoload 'inferior-haskell-info "inf-haskell" "" t)
274 (autoload 'inferior-haskell-find-definition "inf-haskell" "" t)
275 (autoload 'inferior-haskell-find-haddock "inf-haskell" "" t)
277 (add-to-list 'auto-mode-alist '("\\.hs$" . haskell-mode))
278 (add-to-list 'auto-mode-alist '("\\.hsc$" . haskell-mode))
280 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
281 (add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
282 (add-hook 'haskell-mode-hook 'turn-on-haskell-ghci)
284 (load-if-present "~/sandbox/_input-method/haskell-unicode-input-method/haskell-unicode-input-method")
285 (add-hook 'haskell-mode-hook
286 (lambda () (set-input-method "haskell-unicode")))
290 (autoload 'hoogle-lookup "hoogle" "Hoogle" t)
291 (global-set-key (kbd "C-c h") 'hoogle-lookup)
294 (mapcar (lambda (hook)
296 (lambda () (c-set-style "user"))))
303 (autoload 'css-mode "css-mode" "For editing CSS file" t)
304 (setq cssm-indent-level 4)
305 (setq cssm-mirror-mode nil)
306 (setq cssm-indent-function 'cssm-c-style-indenter)
307 (setq auto-mode-alist
309 '(("\\.css$" . css-mode))
313 (autoload 'emacs-wiki-find-file "emacs-wiki" "Emacs Wiki" t)
314 (defalias 'wiki 'emacs-wiki-find-file)
317 (defalias 'perl-mode 'cperl-mode)
318 (setq cperl-indent-level 4)
319 (setq cperl-indent-parens-as-block t)
322 (add-to-list 'load-path "/usr/pkg/lib/erlang/lib/tools-2.6/emacs")
323 (require-if-present 'erlang-start)
324 (setq erlang-electric-commands nil)
327 (require 'skk-autoloads)
328 (global-set-key "\C-x\C-j" 'skk-mode)
329 (global-set-key "\C-xj" 'skk-auto-fill-mode)
330 (global-set-key "\C-xt" 'skk-tutorial)
331 (setq skk-use-jisx0201-input-method t)
332 (setq skk-rom-kana-rule-list
334 ("wi" nil ("ヰ" . "ゐ"))
335 ("we" nil ("ヱ" . "ゑ"))
336 ;;("hh" "h" ("ン" . "ん"))
337 ;;("mm" "m" ("ン" . "ん"))
338 ("zx" nil ("ゝ" . "ヽ"))
339 ("zc" nil ("ゞ" . "ヾ"))))
340 (set-input-method 'japanese-skk) ; INPUT METHOD
343 (autoload 'navi2ch "navi2ch" "Navigator for 2ch for Emacs" t)
346 (require-if-present 'migemo)
349 (setq load-path (cons (expand-file-name "~/sandbox/Tiarra") load-path))
350 (autoload 'tiarra-conf-mode "tiarra-conf" "tiarra.conf editing mode" t)
353 (autoload 'po-mode "po-mode")
354 (setq auto-mode-alist
355 (cons '("\\.po[tx]?\\'\\|\\.po\\." . po-mode)
359 (setq user-full-name "PHO")
360 (setq user-mail-address "pho@cielonegro.org")
364 (add-change-log-entry nil (expand-file-name "~/sync/memo.txt")))
365 (define-key ctl-x-map "M" #'memo)
369 (add-change-log-entry nil (expand-file-name "~/sync/depression.txt")))
370 (define-key ctl-x-map "P" #'depression)
374 (add-change-log-entry nil (expand-file-name "~/sync/plant.txt")))
375 (define-key ctl-x-map "G" #'plant)
378 (add-hook 'calc-start-hook
380 (if (functionp 'paren-deactivate)
381 (paren-deactivate))))
382 (add-hook 'calc-end-hook
384 (if (functionp 'paren-activate)
388 (autoload 'w3m "w3m" "Interface for w3m on Emacs." t)
389 (autoload 'w3m-browse-url "w3m" "Browse url by w3m." t)
390 (autoload 'w3m-find-file "w3m" "w3m interface function for local file." t)
391 (autoload 'w3m-search "w3m-search" "Search QUERY using SEARCH-ENGINE." t)
392 (autoload 'w3m-weather "w3m-weather" "Display weather report." t)
393 (autoload 'w3m-antenna "w3m-antenna" "Report chenge of WEB sites." t)
394 (autoload 'w3m-namazu "w3m-namazu" "Search files with Namazu." t)
397 (autoload 'pov-mode "pov-mode" "POV-Ray scene file mode" t)
398 (setq auto-mode-alist
399 (append '(("\\.pov$" . pov-mode)
400 ("\\.inc$" . pov-mode)
403 ;; End of user configuration ---------------------------------------------------
406 (put 'narrow-to-region 'disabled nil)
407 (custom-set-variables
408 ;; custom-set-variables was added by Custom.
409 ;; If you edit it by hand, you could mess it up, so be careful.
410 ;; Your init file should contain only one such instance.
411 ;; If there is more than one, they won't work right.
412 '(Info-additional-directory-list (quote ("/sw/share/info" "/usr/local/info" "/usr/local/share/info")))
413 '(ac-ignore-case nil)
414 '(appt-display-format (quote window))
415 '(appt-message-warning-time 20)
416 '(canlock-password "a14fa4d2601465d55585c291fa8b3943e189e716")
417 '(cleite:auto-refresh-interval nil)
418 '(cleite:measure-srpc-call-time t)
419 '(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")))
420 '(cperl-merge-trailing-else nil)
421 '(default-frame-alist (quote ((tool-bar-lines . 0) (menu-bar-lines . 1) (width . 80) (height . 25) (right-fringe) (left-fringe))))
422 '(ecb-add-path-for-not-matching-files (quote (t)))
423 '(ecb-help-info-path "/sw/share/info/ecb.info")
424 '(ecb-layout-name "left14")
425 '(ecb-options-version "2.32")
426 '(ecb-show-sources-in-directories-buffer (quote always))
427 '(ecb-tip-of-the-day nil)
428 '(ecb-tree-buffer-style (quote ascii-guides))
429 '(ecb-windows-width 0.2)
430 '(elscreen-display-tab t)
431 '(haskell-program-name "ghci")
432 '(ido-enable-flex-matching t)
434 '(ido-ignore-files (quote ("\\`CVS/" "\\`#" "\\`.#" "\\`\\.\\./" "\\`\\./" "\\.ttc")))
435 '(ido-work-directory-list-ignore-regexps (quote ("^\\(/mnt/ibm/\\|/Volumes/IBM80GB/\\)")))
436 '(indent-tabs-mode nil)
437 '(jabber-nickname "PHO")
438 '(jabber-resource "emacs")
439 '(jabber-server "jabber.jp")
440 '(jabber-username "phonohawk")
441 '(jaspace-highlight-tabs t)
442 '(js2-auto-indent-flag nil)
443 '(js2-basic-offset 4)
444 '(js2-indent-on-enter-key nil)
445 '(js2-mirror-mode nil)
446 '(js2-use-font-lock-faces t)
447 '(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))))
448 '(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")))))
449 '(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")))
450 '(mew-spam: "X-Text-Classification:")
451 '(mew-summary-form (quote (type (5 date) " " (14 from) " " t (14 x-classification) " " (30 subj) "|" (0 body))))
452 '(mouse-wheel-progessive-speed nil)
453 '(mouse-wheel-scroll-amount (quote (1 ((shift) . 5) ((control)))))
454 '(navi2ch-browse-url-browser-function (quote browse-url-firefox))
455 '(navi2ch-display-splash-screen nil)
456 '(navi2ch-list-moved-board-alist (quote (("http://mamono.2ch.net/ihou/" . "http://hideyoshi.2ch.net/ihou/"))))
457 '(navi2ch-mona-face-variable (quote navi2ch-mona12-face))
458 '(navi2ch-mona-on-message-mode t)
459 '(newsticker-html-renderer (quote w3m-region))
460 '(newsticker-url-list nil)
461 '(newsticker-url-list-defaults (quote (("slashdot" "http://slashdot.org/index.rss" nil 3600))))
462 '(nxml-auto-insert-xml-declaration-flag t)
463 '(nxml-slash-auto-complete-flag t)
464 '(rcirc-server-alist (quote (("irc1.ymir.jp" :nick "PHO`cons" nil nil))))
465 '(riece-layout "default")
466 '(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"))))
467 '(riece-others-buffer-mode nil)
468 '(rng-schema-locating-files (quote ("schemas.xml" "/sw/share/schema/schemas.xml" "~/share/nxml/schemas.xml")))
469 '(rst-level-face-base-light 50)
470 '(safe-local-variable-values (quote ((todo-categories "Todo" "Todo" "Todo" "Todo"))))
471 '(tramp-auto-save-directory "/tmp/tramp-auto-save")
472 '(tramp-completion-reread-directory-timeout 2)
473 '(tramp-default-host "localhost")
474 '(w3m-bookmark-file-coding-system (quote utf-8))
475 '(w3m-coding-system (quote utf-8))
476 '(w3m-coding-system-priority-list (quote (utf-8)))
477 '(w3m-default-coding-system (quote utf-8))
478 '(w3m-default-display-inline-images t)
479 '(w3m-file-coding-system (quote utf-8))
480 '(w3m-file-name-coding-system (quote utf-8))
481 '(w3m-fill-column 80)
482 '(w3m-input-coding-system (quote utf-8))
483 '(w3m-key-binding nil)
484 '(w3m-output-coding-system (quote utf-8))
485 '(w3m-terminal-coding-system (quote utf-8))
487 '(x-select-enable-clipboard t))
489 ;; custom-set-faces was added by Custom.
490 ;; If you edit it by hand, you could mess it up, so be careful.
491 ;; Your init file should contain only one such instance.
492 ;; If there is more than one, they won't work right.
493 '(flyspell-incorrect ((t (:foreground "OrangeRed" :overline t))))
494 '(jaspace-highlight-tab-face ((((class color) (background dark)) (:foreground "gray70" :underline t))))
495 '(which-func-face ((t (:background "black" :foreground "dark orange")))))