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-subtle-hacker))
126 (require-if-present 'auto-complete-config)
127 (if (featurep 'auto-complete-config)
129 (add-to-list 'ac-dictionary-directories
130 "/usr/pkg/share/emacs/site-lisp/auto-complete/ac-dict")
131 (mapcar (lambda (mode)
132 (add-to-list 'ac-modes mode))
135 (setq ac-modes (remove 'css-mode ac-modes))
136 (add-hook 'erlang-mode-hook
138 (add-to-list 'ac-sources 'ac-source-semantic)))
139 (ac-config-default)))
142 (require-if-present 'mic-paren)
143 (if (featurep 'mic-paren)
147 (load "elscreen" "ElScreen" t)
148 (require-if-present 'elscreen-w3m)
151 (require-if-present 'undo-tree)
152 (if (featurep 'undo-tree)
153 (global-undo-tree-mode))
156 ;(require-if-present 'mpc-autoloads)
159 (autoload 'rst-mode "rst"
160 "mode for editing reStructuredText documents" t)
161 (setq auto-mode-alist
162 (append '(("\\.rst$" . rst-mode)
163 ("\\.rest$" . rst-mode)) auto-mode-alist))
166 (autoload 'lua-mode "lua-mode" "Lua editing mode." t)
167 (add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode) auto-mode-alist)
170 (require-if-present 'twittering-mode)
171 (setq twittering-username "phonohawk")
174 (autoload 'riece "riece" "Start Riece" t)
175 (add-hook 'riece-after-load-startup-hook
177 (add-to-list 'riece-addons 'riece-alias)
178 (add-to-list 'riece-addons 'riece-skk-kakutei)
179 (add-to-list 'riece-addons 'riece-keyword)
180 (add-to-list 'riece-addons 'riece-ctlseq)))
183 (require-if-present 'ecb-autoloads)
184 (let* ((hosts '(("netbsd." .
185 (("~/sandbox/yxmimeproc" "yxmimeproc")
186 ("~/sandbox/YxMIME" "YxMIME.pm")
189 (("~/sandbox/MR/engine/libycom" "libycom")
191 ("aria.cielonegro.org" .
192 (("~/sandbox/_web-app/Rakka" "Rakka")
193 ("~/sandbox/_haskell/Lucu" "Lucu")
194 ("~/sandbox/_web-app/Kirschbaum" "Kirschbaum")
195 ("~/sandbox/_haskell/HsOpenSSL" "HsOpenSSL")
196 ("~/sandbox/_haskell/HsHyperEstraier" "HsHyperEstraier")
197 ("~/sandbox/_haskell/HsSVN" "HsSVN")
198 ("~/sandbox/_game/RoRo" "RoRo")
199 ("~/sandbox/_haskell/HXT" "HXT")
200 ("~/sandbox/_haskell/hxt-compile" "hxt-compile")
201 ("~/src/ghc-6.10.1" "ghc-6.10.1")
202 ("~/sandbox/sugar" "sugar")
203 ("~/sandbox/_haskell/dns" "dns")
204 ("~/sandbox/_haskell/blackboard-ddns" "blackboard-ddns")
206 (paths (cdr (assoc (system-name) hosts))))
207 (setq ecb-source-path paths))
210 (require-if-present 'gaelic)
213 (autoload 'rnc-mode "rnc-mode")
214 (add-to-list 'auto-mode-alist '("\\.rnc\\'" . rnc-mode))
217 (setq bookmark-sort-flag nil)
220 (autoload 'sudoku "sudoku" "The Sudoku" t)
223 (autoload 'mew "mew" "Mew" t)
226 (autoload 'cleite "cleite" "Cleite RSS Aggregator -- Emacs Interface" t)
229 (autoload 'js2-mode "js2" nil t)
230 (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
237 (autoload 'sokoban "sokoban.el" "Start a new game of Sokoban." t)
238 (autoload 'sokoban-mode "sokoban.el" "Play Sokoban in current buffer." t)
239 (setq sokoban-playerfiles-dir "/usr/local/var/games/emacs-sokoban")
242 (load-file-if-present "/usr/pkg/share/emacs/site-lisp/nxml-mode/rng-auto.el")
243 (defalias 'xml-mode 'nxml-mode)
244 (add-to-list 'auto-mode-alist '("\\.xml$" . nxml-mode))
245 (add-to-list 'auto-mode-alist '("\\.xi$" . nxml-mode))
246 (add-to-list 'auto-mode-alist '("\\.rdf$" . nxml-mode))
247 (add-to-list 'auto-mode-alist '("\\.rng$" . nxml-mode))
250 (autoload 'sstp-mode "sstp" "SSTP Editing Major-Mode" t)
253 (autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files")
254 (setq auto-mode-alist
255 (append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
256 (setq interpreter-mode-alist (append '(("ruby" .ruby-mode))
257 interpreter-mode-alist))
258 (autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process")
259 (autoload 'inf-ruby-keys "inf-ruby" "set local key defs for inf-ruby in ruby-mode")
260 (add-hook 'ruby-mode-hook
266 (load-if-present "haskell-site-file.el")
268 (autoload 'run-haskell "inf-haskell" "" t)
269 (autoload 'switch-to-haskell "inf-haskell" "" t)
270 (autoload 'inferior-haskell-load-file "inf-haskell" "" t)
271 (autoload 'inferior-haskell-type "inf-haskell" "" t)
272 (autoload 'inferior-haskell-info "inf-haskell" "" t)
273 (autoload 'inferior-haskell-find-definition "inf-haskell" "" t)
274 (autoload 'inferior-haskell-find-haddock "inf-haskell" "" t)
276 (add-to-list 'auto-mode-alist '("\\.hs$" . haskell-mode))
277 (add-to-list 'auto-mode-alist '("\\.hsc$" . haskell-mode))
279 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
280 (add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
281 (add-hook 'haskell-mode-hook 'turn-on-haskell-ghci)
283 (load-if-present "~/sandbox/_input-method/haskell-unicode-input-method/haskell-unicode-input-method")
284 (add-hook 'haskell-mode-hook
285 (lambda () (set-input-method "haskell-unicode")))
289 (autoload 'hoogle-lookup "hoogle" "Hoogle" t)
290 (global-set-key (kbd "C-c h") 'hoogle-lookup)
293 (mapcar (lambda (hook)
295 (lambda () (c-set-style "user"))))
302 (autoload 'css-mode "css-mode" "For editing CSS file" t)
303 (setq cssm-indent-level 4)
304 (setq cssm-mirror-mode nil)
305 (setq cssm-indent-function 'cssm-c-style-indenter)
306 (setq auto-mode-alist
308 '(("\\.css$" . css-mode))
312 (autoload 'emacs-wiki-find-file "emacs-wiki" "Emacs Wiki" t)
313 (defalias 'wiki 'emacs-wiki-find-file)
316 (defalias 'perl-mode 'cperl-mode)
317 (setq cperl-indent-level 4)
318 (setq cperl-indent-parens-as-block t)
321 (add-to-list 'load-path "/usr/pkg/lib/erlang/lib/tools-2.6/emacs")
322 (require-if-present 'erlang-start)
323 (setq erlang-electric-commands nil)
326 (require 'skk-autoloads)
327 (global-set-key "\C-x\C-j" 'skk-mode)
328 (global-set-key "\C-xj" 'skk-auto-fill-mode)
329 (global-set-key "\C-xt" 'skk-tutorial)
330 (setq skk-use-jisx0201-input-method t)
331 (setq skk-rom-kana-rule-list
333 ("wi" nil ("ヰ" . "ゐ"))
334 ("we" nil ("ヱ" . "ゑ"))
335 ;;("hh" "h" ("ン" . "ん"))
336 ;;("mm" "m" ("ン" . "ん"))
337 ("zx" nil ("ゝ" . "ヽ"))
338 ("zc" nil ("ゞ" . "ヾ"))))
339 (set-input-method 'japanese-skk) ; INPUT METHOD
342 (autoload 'navi2ch "navi2ch" "Navigator for 2ch for Emacs" t)
345 (require-if-present 'migemo)
348 (setq load-path (cons (expand-file-name "~/sandbox/Tiarra") load-path))
349 (autoload 'tiarra-conf-mode "tiarra-conf" "tiarra.conf editing mode" t)
352 (autoload 'po-mode "po-mode")
353 (setq auto-mode-alist
354 (cons '("\\.po[tx]?\\'\\|\\.po\\." . po-mode)
358 (setq user-full-name "PHO")
359 (setq user-mail-address "pho@cielonegro.org")
363 (add-change-log-entry nil (expand-file-name "~/sync/memo.txt")))
364 (define-key ctl-x-map "M" #'memo)
368 (add-change-log-entry nil (expand-file-name "~/sync/depression.txt")))
369 (define-key ctl-x-map "P" #'depression)
373 (add-change-log-entry nil (expand-file-name "~/sync/plant.txt")))
374 (define-key ctl-x-map "G" #'plant)
377 (add-hook 'calc-start-hook
379 (if (functionp 'paren-deactivate)
380 (paren-deactivate))))
381 (add-hook 'calc-end-hook
383 (if (functionp 'paren-activate)
387 (autoload 'w3m "w3m" "Interface for w3m on Emacs." t)
388 (autoload 'w3m-browse-url "w3m" "Browse url by w3m." t)
389 (autoload 'w3m-find-file "w3m" "w3m interface function for local file." t)
390 (autoload 'w3m-search "w3m-search" "Search QUERY using SEARCH-ENGINE." t)
391 (autoload 'w3m-weather "w3m-weather" "Display weather report." t)
392 (autoload 'w3m-antenna "w3m-antenna" "Report chenge of WEB sites." t)
393 (autoload 'w3m-namazu "w3m-namazu" "Search files with Namazu." t)
396 (autoload 'pov-mode "pov-mode" "POV-Ray scene file mode" t)
397 (setq auto-mode-alist
398 (append '(("\\.pov$" . pov-mode)
399 ("\\.inc$" . pov-mode)
402 ;; End of user configuration ---------------------------------------------------
405 (put 'narrow-to-region 'disabled nil)
406 (custom-set-variables
407 ;; custom-set-variables was added by Custom.
408 ;; If you edit it by hand, you could mess it up, so be careful.
409 ;; Your init file should contain only one such instance.
410 ;; If there is more than one, they won't work right.
411 '(Info-additional-directory-list (quote ("/sw/share/info" "/usr/local/info" "/usr/local/share/info")))
412 '(ac-ignore-case nil)
413 '(appt-display-format (quote window))
414 '(appt-message-warning-time 20)
415 '(canlock-password "a14fa4d2601465d55585c291fa8b3943e189e716")
416 '(cleite:auto-refresh-interval nil)
417 '(cleite:measure-srpc-call-time t)
418 '(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")))
419 '(cperl-merge-trailing-else nil)
420 '(default-frame-alist (quote ((tool-bar-lines . 0) (menu-bar-lines . 1) (width . 80) (height . 25) (right-fringe) (left-fringe))))
421 '(ecb-add-path-for-not-matching-files (quote (t)))
422 '(ecb-help-info-path "/sw/share/info/ecb.info")
423 '(ecb-layout-name "left14")
424 '(ecb-options-version "2.32")
425 '(ecb-show-sources-in-directories-buffer (quote always))
426 '(ecb-tip-of-the-day nil)
427 '(ecb-tree-buffer-style (quote ascii-guides))
428 '(ecb-windows-width 0.2)
429 '(elscreen-display-tab t)
430 '(haskell-program-name "ghci")
431 '(ido-enable-flex-matching t)
433 '(ido-ignore-files (quote ("\\`CVS/" "\\`#" "\\`.#" "\\`\\.\\./" "\\`\\./" "\\.ttc")))
434 '(ido-work-directory-list-ignore-regexps (quote ("^\\(/mnt/ibm/\\|/Volumes/IBM80GB/\\)")))
435 '(indent-tabs-mode nil)
436 '(jabber-nickname "PHO")
437 '(jabber-resource "emacs")
438 '(jabber-server "jabber.jp")
439 '(jabber-username "phonohawk")
440 '(jaspace-highlight-tabs t)
441 '(js2-auto-indent-flag nil)
442 '(js2-basic-offset 4)
443 '(js2-indent-on-enter-key nil)
444 '(js2-mirror-mode nil)
445 '(js2-use-font-lock-faces t)
446 '(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))))
447 '(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")))))
448 '(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")))
449 '(mew-spam: "X-Text-Classification:")
450 '(mew-summary-form (quote (type (5 date) " " (14 from) " " t (14 x-classification) " " (30 subj) "|" (0 body))))
451 '(mouse-wheel-progessive-speed nil)
452 '(mouse-wheel-scroll-amount (quote (1 ((shift) . 5) ((control)))))
453 '(navi2ch-browse-url-browser-function (quote browse-url-firefox))
454 '(navi2ch-display-splash-screen nil)
455 '(navi2ch-list-moved-board-alist (quote (("http://mamono.2ch.net/ihou/" . "http://hideyoshi.2ch.net/ihou/"))))
456 '(navi2ch-mona-face-variable (quote navi2ch-mona12-face))
457 '(navi2ch-mona-on-message-mode t)
458 '(newsticker-html-renderer (quote w3m-region))
459 '(newsticker-url-list nil)
460 '(newsticker-url-list-defaults (quote (("slashdot" "http://slashdot.org/index.rss" nil 3600))))
461 '(nxml-auto-insert-xml-declaration-flag t)
462 '(nxml-slash-auto-complete-flag t)
463 '(rcirc-server-alist (quote (("irc1.ymir.jp" :nick "PHO`cons" nil nil))))
464 '(riece-layout "default")
465 '(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"))))
466 '(riece-others-buffer-mode nil)
467 '(rng-schema-locating-files (quote ("schemas.xml" "/sw/share/schema/schemas.xml" "~/share/nxml/schemas.xml")))
468 '(rst-level-face-base-light 50)
469 '(safe-local-variable-values (quote ((todo-categories "Todo" "Todo" "Todo" "Todo"))))
470 '(tramp-auto-save-directory "/tmp/tramp-auto-save")
471 '(tramp-completion-reread-directory-timeout 2)
472 '(tramp-default-host "localhost")
473 '(w3m-bookmark-file-coding-system (quote utf-8))
474 '(w3m-coding-system (quote utf-8))
475 '(w3m-coding-system-priority-list (quote (utf-8)))
476 '(w3m-default-coding-system (quote utf-8))
477 '(w3m-default-display-inline-images t)
478 '(w3m-file-coding-system (quote utf-8))
479 '(w3m-file-name-coding-system (quote utf-8))
480 '(w3m-fill-column 80)
481 '(w3m-input-coding-system (quote utf-8))
482 '(w3m-key-binding nil)
483 '(w3m-output-coding-system (quote utf-8))
484 '(w3m-terminal-coding-system (quote utf-8))
486 '(x-select-enable-clipboard t))
488 ;; custom-set-faces was added by Custom.
489 ;; If you edit it by hand, you could mess it up, so be careful.
490 ;; Your init file should contain only one such instance.
491 ;; If there is more than one, they won't work right.
492 '(flyspell-incorrect ((t (:foreground "OrangeRed" :overline t))))
493 '(jaspace-highlight-tab-face ((((class color) (background dark)) (:foreground "gray70" :underline t))))
494 '(which-func-face ((t (:background "black" :foreground "dark orange")))))