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")
41 ;; Use firefox as the default browser.
42 (setq browse-url-firefox-program "/opt/local/bin/firefox")
43 ;; Specify how to connect to some of the remote servers.
44 (setq tramp-default-proxies-alist nil)
45 (add-to-list 'tramp-default-proxies-alist
46 '("rd8" nil "/sshx:pho@yebisu1.ymir.jp:"))
47 (add-to-list 'tramp-default-proxies-alist
48 '("yebisu1\\.ymir\\.jp" nil "/sshx:pho@boss:"))))))
50 ;; Settings for Browser --------------------------------------------------------
51 (setq browse-url-browser-function 'w3m-browse-url)
52 (global-set-key "\C-xm" 'browse-url-at-point)
54 ;; Setting for the Mode Line ---------------------------------------------------
56 (column-number-mode t)
59 ;; Setting for Frames ----------------------------------------------------------
61 (if (equal (system-name) "seras")
62 (set-default-font "Dejavu Sans Mono 11")
63 (set-default-font "Dejavu Sans Mono 13")))
66 ; (set-default-font "Inconsolata-14")
67 ; (set-face-font 'variable-pitch "Inconsolata-14")
68 ; (set-fontset-font (frame-parameter nil 'font)
70 ; '("Takaoゴシック" . "unicode-bmp")))
73 ; (add-to-list 'default-frame-alist
74 ; '(font . "Bitstream Vera Sans Mono 12"))
75 ; (set-frame-font "Bitstream Vera Sans Mono 12")
76 ; (set-fontset-font nil;(frame-parameter nil 'font)
78 ; '("Hiragino Kaku Gothic Pro W3" . "unicode-bmp")))
80 ;; Hooks for newline-and-indent ------------------------------------------------
81 ;(mapcar (lambda (hook)
84 ; (local-set-key "\C-m" 'newline-and-indent)
85 ; (local-set-key "\C-j" 'newline)
90 ; javascript-mode-hook
94 ; emacs-lisp-mode-hook
100 ;; Setting for Packages --------------------------------------------------------
101 (defun require-if-present (feature)
105 (if (equal (cadr e) "Cannot open load file")
106 (message "Warning: feature %s is absent" feature) ; warn and ignore
107 (apply 'signal (car e) (cdr e)))))) ; rethrow
109 (defun load-if-present (file)
113 (if (equal (cadr e) "Cannot open load file")
114 (message "Warning: file named %s is absent" file) ; warn and ignore
115 (apply 'signal (car e) (cdr e)))))) ; rethrow
117 (defun load-file-if-present (path)
118 (if (file-exists-p path)
120 (message "Warning: file %s is absent" path)))
123 (require-if-present 'flyspell)
126 (require-if-present 'jaspace)
129 (require-if-present 'color-theme)
130 (if (featurep 'color-theme)
132 (color-theme-initialize)
133 (color-theme-subtle-hacker)))
136 (require-if-present 'auto-complete-config)
137 (if (featurep 'auto-complete-config)
139 (add-to-list 'ac-dictionary-directories
140 "/usr/pkg/share/emacs/site-lisp/auto-complete/ac-dict")
141 (mapcar (lambda (mode)
142 (add-to-list 'ac-modes mode))
145 (setq ac-modes (remove 'css-mode ac-modes))
146 (add-hook 'erlang-mode-hook
148 (add-to-list 'ac-sources 'ac-source-semantic)))
149 (ac-config-default)))
152 (require-if-present 'mic-paren)
153 (if (featurep 'mic-paren)
157 (load "elscreen" "ElScreen" t)
158 (require-if-present 'elscreen-w3m)
161 (require-if-present 'undo-tree)
162 (if (featurep 'undo-tree)
163 (global-undo-tree-mode))
166 ;(require-if-present 'mpc-autoloads)
169 (autoload 'rst-mode "rst"
170 "mode for editing reStructuredText documents" t)
171 (setq auto-mode-alist
172 (append '(("\\.rst$" . rst-mode)
173 ("\\.rest$" . rst-mode)) auto-mode-alist))
176 (autoload 'lua-mode "lua-mode" "Lua editing mode." t)
177 (add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode) auto-mode-alist)
180 (require-if-present 'twittering-mode)
181 (setq twittering-username "phonohawk")
184 (autoload 'riece "riece" "Start Riece" t)
185 (add-hook 'riece-after-load-startup-hook
187 (add-to-list 'riece-addons 'riece-alias)
188 (add-to-list 'riece-addons 'riece-skk-kakutei)
189 (add-to-list 'riece-addons 'riece-keyword)
190 (add-to-list 'riece-addons 'riece-ctlseq)))
193 (require-if-present 'ecb-autoloads)
194 (let* ((hosts '(("netbsd." .
195 (("~/sandbox/yxmimeproc" "yxmimeproc")
196 ("~/sandbox/YxMIME" "YxMIME.pm")
199 (("~/sandbox/MR/engine/libycom" "libycom")
201 ("aria.cielonegro.org" .
202 (("~/sandbox/_web-app/Rakka" "Rakka")
203 ("~/sandbox/_haskell/Lucu" "Lucu")
204 ("~/sandbox/_web-app/Kirschbaum" "Kirschbaum")
205 ("~/sandbox/_haskell/HsOpenSSL" "HsOpenSSL")
206 ("~/sandbox/_haskell/HsHyperEstraier" "HsHyperEstraier")
207 ("~/sandbox/_haskell/HsSVN" "HsSVN")
208 ("~/sandbox/_game/RoRo" "RoRo")
209 ("~/sandbox/_haskell/HXT" "HXT")
210 ("~/sandbox/_haskell/hxt-compile" "hxt-compile")
211 ("~/src/ghc-6.10.1" "ghc-6.10.1")
212 ("~/sandbox/sugar" "sugar")
213 ("~/sandbox/_haskell/dns" "dns")
214 ("~/sandbox/_haskell/blackboard-ddns" "blackboard-ddns")
216 (paths (cdr (assoc (system-name) hosts))))
217 (setq ecb-source-path paths))
220 (require-if-present 'gaelic)
223 (autoload 'rnc-mode "rnc-mode")
224 (add-to-list 'auto-mode-alist '("\\.rnc\\'" . rnc-mode))
227 (setq bookmark-sort-flag nil)
230 (autoload 'sudoku "sudoku" "The Sudoku" t)
233 (autoload 'mew "mew" "Mew" t)
236 (autoload 'cleite "cleite" "Cleite RSS Aggregator -- Emacs Interface" t)
239 (autoload 'js2-mode "js2" nil t)
240 (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
247 (autoload 'sokoban "sokoban.el" "Start a new game of Sokoban." t)
248 (autoload 'sokoban-mode "sokoban.el" "Play Sokoban in current buffer." t)
249 (setq sokoban-playerfiles-dir "/usr/local/var/games/emacs-sokoban")
252 (load-file-if-present "/usr/pkg/share/emacs/site-lisp/nxml-mode/rng-auto.el")
253 (defalias 'xml-mode 'nxml-mode)
254 (add-to-list 'auto-mode-alist '("\\.xml$" . nxml-mode))
255 (add-to-list 'auto-mode-alist '("\\.xi$" . nxml-mode))
256 (add-to-list 'auto-mode-alist '("\\.rdf$" . nxml-mode))
257 (add-to-list 'auto-mode-alist '("\\.rng$" . nxml-mode))
260 (autoload 'sstp-mode "sstp" "SSTP Editing Major-Mode" t)
263 (autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files")
264 (setq auto-mode-alist
265 (append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
266 (setq interpreter-mode-alist (append '(("ruby" .ruby-mode))
267 interpreter-mode-alist))
268 (autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process")
269 (autoload 'inf-ruby-keys "inf-ruby" "set local key defs for inf-ruby in ruby-mode")
270 (add-hook 'ruby-mode-hook
276 (load-if-present "haskell-site-file.el")
278 (autoload 'run-haskell "inf-haskell" "" t)
279 (autoload 'switch-to-haskell "inf-haskell" "" t)
280 (autoload 'inferior-haskell-load-file "inf-haskell" "" t)
281 (autoload 'inferior-haskell-type "inf-haskell" "" t)
282 (autoload 'inferior-haskell-info "inf-haskell" "" t)
283 (autoload 'inferior-haskell-find-definition "inf-haskell" "" t)
284 (autoload 'inferior-haskell-find-haddock "inf-haskell" "" t)
286 (add-to-list 'auto-mode-alist '("\\.hs$" . haskell-mode))
287 (add-to-list 'auto-mode-alist '("\\.hsc$" . haskell-mode))
289 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
290 (add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
291 (add-hook 'haskell-mode-hook 'turn-on-haskell-ghci)
293 (load-if-present "~/sandbox/_input-method/haskell-unicode-input-method/haskell-unicode-input-method")
294 (add-hook 'haskell-mode-hook
295 (lambda () (set-input-method "haskell-unicode")))
299 (autoload 'hoogle-lookup "hoogle" "Hoogle" t)
300 (global-set-key (kbd "C-c h") 'hoogle-lookup)
303 (mapcar (lambda (hook)
305 (lambda () (c-set-style "user"))))
312 (autoload 'css-mode "css-mode" "For editing CSS file" t)
313 (setq cssm-indent-level 4)
314 (setq cssm-mirror-mode nil)
315 (setq cssm-indent-function 'cssm-c-style-indenter)
316 (setq auto-mode-alist
318 '(("\\.css$" . css-mode))
322 (autoload 'emacs-wiki-find-file "emacs-wiki" "Emacs Wiki" t)
323 (defalias 'wiki 'emacs-wiki-find-file)
326 (defalias 'perl-mode 'cperl-mode)
327 (setq cperl-indent-level 4)
328 (setq cperl-indent-parens-as-block t)
331 (add-to-list 'load-path "/usr/pkg/lib/erlang/lib/tools-2.6/emacs")
332 (require-if-present 'erlang-start)
333 (setq erlang-electric-commands nil)
336 (require 'skk-autoloads)
337 (global-set-key "\C-x\C-j" 'skk-mode)
338 (global-set-key "\C-xj" 'skk-auto-fill-mode)
339 (global-set-key "\C-xt" 'skk-tutorial)
340 (setq skk-use-jisx0201-input-method t)
341 (setq skk-rom-kana-rule-list
343 ("wi" nil ("ヰ" . "ゐ"))
344 ("we" nil ("ヱ" . "ゑ"))
345 ;;("hh" "h" ("ン" . "ん"))
346 ;;("mm" "m" ("ン" . "ん"))
347 ("zx" nil ("ゝ" . "ヽ"))
348 ("zc" nil ("ゞ" . "ヾ"))))
349 (set-input-method 'japanese-skk) ; INPUT METHOD
352 (autoload 'navi2ch "navi2ch" "Navigator for 2ch for Emacs" t)
355 (require-if-present 'migemo)
358 (setq load-path (cons (expand-file-name "~/sandbox/Tiarra") load-path))
359 (autoload 'tiarra-conf-mode "tiarra-conf" "tiarra.conf editing mode" t)
362 (autoload 'po-mode "po-mode")
363 (setq auto-mode-alist
364 (cons '("\\.po[tx]?\\'\\|\\.po\\." . po-mode)
368 (setq user-full-name "PHO")
369 (setq user-mail-address "pho@cielonegro.org")
373 (add-change-log-entry nil (expand-file-name "~/sync/memo.txt")))
374 (define-key ctl-x-map "M" #'memo)
378 (add-change-log-entry nil (expand-file-name "~/sync/depression.txt")))
379 (define-key ctl-x-map "P" #'depression)
383 (add-change-log-entry nil (expand-file-name "~/sync/plant.txt")))
384 (define-key ctl-x-map "G" #'plant)
387 (add-hook 'calc-start-hook
389 (if (functionp 'paren-deactivate)
390 (paren-deactivate))))
391 (add-hook 'calc-end-hook
393 (if (functionp 'paren-activate)
397 (autoload 'w3m "w3m" "Interface for w3m on Emacs." t)
398 (autoload 'w3m-browse-url "w3m" "Browse url by w3m." t)
399 (autoload 'w3m-find-file "w3m" "w3m interface function for local file." t)
400 (autoload 'w3m-search "w3m-search" "Search QUERY using SEARCH-ENGINE." t)
401 (autoload 'w3m-weather "w3m-weather" "Display weather report." t)
402 (autoload 'w3m-antenna "w3m-antenna" "Report chenge of WEB sites." t)
403 (autoload 'w3m-namazu "w3m-namazu" "Search files with Namazu." t)
406 (autoload 'pov-mode "pov-mode" "POV-Ray scene file mode" t)
407 (setq auto-mode-alist
408 (append '(("\\.pov$" . pov-mode)
409 ("\\.inc$" . pov-mode)
412 ;; End of user configuration ---------------------------------------------------
415 (put 'narrow-to-region 'disabled nil)
416 (custom-set-variables
417 ;; custom-set-variables was added by Custom.
418 ;; If you edit it by hand, you could mess it up, so be careful.
419 ;; Your init file should contain only one such instance.
420 ;; If there is more than one, they won't work right.
421 '(Info-additional-directory-list (quote ("/sw/share/info" "/usr/local/info" "/usr/local/share/info")))
422 '(ac-ignore-case nil)
423 '(appt-display-format (quote window))
424 '(appt-message-warning-time 20)
425 '(canlock-password "a14fa4d2601465d55585c291fa8b3943e189e716")
426 '(cleite:auto-refresh-interval nil)
427 '(cleite:measure-srpc-call-time t)
428 '(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")))
429 '(cperl-merge-trailing-else nil)
430 '(default-frame-alist (quote ((tool-bar-lines . 0) (menu-bar-lines . 1) (width . 80) (height . 25) (right-fringe) (left-fringe))))
431 '(ecb-add-path-for-not-matching-files (quote (t)))
432 '(ecb-help-info-path "/sw/share/info/ecb.info")
433 '(ecb-layout-name "left14")
434 '(ecb-options-version "2.32")
435 '(ecb-show-sources-in-directories-buffer (quote always))
436 '(ecb-tip-of-the-day nil)
437 '(ecb-tree-buffer-style (quote ascii-guides))
438 '(ecb-windows-width 0.2)
439 '(elscreen-display-tab t)
440 '(haskell-program-name "ghci")
441 '(ido-enable-flex-matching t)
443 '(ido-ignore-files (quote ("\\`CVS/" "\\`#" "\\`.#" "\\`\\.\\./" "\\`\\./" "\\.ttc")))
444 '(ido-work-directory-list-ignore-regexps (quote ("^\\(/mnt/ibm/\\|/Volumes/IBM80GB/\\)")))
445 '(indent-tabs-mode nil)
446 '(jabber-nickname "PHO")
447 '(jabber-resource "emacs")
448 '(jabber-server "jabber.jp")
449 '(jabber-username "phonohawk")
450 '(jaspace-highlight-tabs t)
451 '(js2-auto-indent-flag nil)
452 '(js2-basic-offset 4)
453 '(js2-indent-on-enter-key nil)
454 '(js2-mirror-mode nil)
455 '(js2-use-font-lock-faces t)
456 '(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))))
457 '(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")))))
458 '(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")))
459 '(mew-spam: "X-Text-Classification:")
460 '(mew-summary-form (quote (type (5 date) " " (14 from) " " t (14 x-classification) " " (30 subj) "|" (0 body))))
461 '(mouse-wheel-progessive-speed nil)
462 '(mouse-wheel-scroll-amount (quote (1 ((shift) . 5) ((control)))))
463 '(navi2ch-browse-url-browser-function (quote browse-url-firefox))
464 '(navi2ch-display-splash-screen nil)
465 '(navi2ch-list-moved-board-alist (quote (("http://mamono.2ch.net/ihou/" . "http://hideyoshi.2ch.net/ihou/"))))
466 '(navi2ch-mona-face-variable (quote navi2ch-mona12-face))
467 '(navi2ch-mona-on-message-mode t)
468 '(newsticker-html-renderer (quote w3m-region))
469 '(newsticker-url-list nil)
470 '(newsticker-url-list-defaults (quote (("slashdot" "http://slashdot.org/index.rss" nil 3600))))
471 '(nxml-auto-insert-xml-declaration-flag t)
472 '(nxml-slash-auto-complete-flag t)
473 '(rcirc-server-alist (quote (("irc1.ymir.jp" :nick "PHO`cons" nil nil))))
474 '(riece-layout "default")
475 '(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"))))
476 '(riece-others-buffer-mode nil)
477 '(rng-schema-locating-files (quote ("schemas.xml" "/sw/share/schema/schemas.xml" "~/share/nxml/schemas.xml")))
478 '(rst-level-face-base-light 50)
479 '(safe-local-variable-values (quote ((todo-categories "Todo" "Todo" "Todo" "Todo"))))
480 '(tramp-auto-save-directory "/tmp/tramp-auto-save")
481 '(tramp-completion-reread-directory-timeout 2)
482 '(tramp-default-host "localhost")
483 '(tramp-default-method "sshx")
484 '(w3m-bookmark-file-coding-system (quote utf-8))
485 '(w3m-coding-system (quote utf-8))
486 '(w3m-coding-system-priority-list (quote (utf-8)))
487 '(w3m-default-coding-system (quote utf-8))
488 '(w3m-default-display-inline-images t)
489 '(w3m-file-coding-system (quote utf-8))
490 '(w3m-file-name-coding-system (quote utf-8))
491 '(w3m-fill-column 80)
492 '(w3m-input-coding-system (quote utf-8))
493 '(w3m-key-binding nil)
494 '(w3m-output-coding-system (quote utf-8))
495 '(w3m-terminal-coding-system (quote utf-8))
497 '(x-select-enable-clipboard t))
499 ;; custom-set-faces was added by Custom.
500 ;; If you edit it by hand, you could mess it up, so be careful.
501 ;; Your init file should contain only one such instance.
502 ;; If there is more than one, they won't work right.
503 '(flyspell-incorrect ((t (:foreground "OrangeRed" :overline t))))
504 '(jaspace-highlight-tab-face ((((class color) (background dark)) (:foreground "gray70" :underline t))))
505 '(which-func-face ((t (:background "black" :foreground "dark orange")))))