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 (set-default-font "Dejavu Sans Mono 13"))
56 ; (set-default-font "Inconsolata-14")
57 ; (set-face-font 'variable-pitch "Inconsolata-14")
58 ; (set-fontset-font (frame-parameter nil 'font)
60 ; '("Takaoゴシック" . "unicode-bmp")))
63 ; (add-to-list 'default-frame-alist
64 ; '(font . "Bitstream Vera Sans Mono 12"))
65 ; (set-frame-font "Bitstream Vera Sans Mono 12")
66 ; (set-fontset-font nil;(frame-parameter nil 'font)
68 ; '("Hiragino Kaku Gothic Pro W3" . "unicode-bmp")))
70 ;; Hooks for newline-and-indent ------------------------------------------------
71 ;(mapcar (lambda (hook)
74 ; (local-set-key "\C-m" 'newline-and-indent)
75 ; (local-set-key "\C-j" 'newline)
80 ; javascript-mode-hook
84 ; emacs-lisp-mode-hook
90 ;; Setting for Packages --------------------------------------------------------
91 (defun require-if-present (feature)
95 (if (equal (cadr e) "Cannot open load file")
96 (message "Warning: feature %s is absent" feature) ; warn and ignore
97 (apply 'signal (car e) (cdr e)))))) ; rethrow
99 (defun load-if-present (file)
103 (if (equal (cadr e) "Cannot open load file")
104 (message "Warning: file named %s is absent" file) ; warn and ignore
105 (apply 'signal (car e) (cdr e)))))) ; rethrow
107 (defun load-file-if-present (path)
108 (if (file-exists-p path)
110 (message "Warning: file %s is absent" path)))
113 (require-if-present 'flyspell)
116 (require-if-present 'jaspace)
119 (require-if-present 'auto-complete-config)
120 (if (featurep 'auto-complete-config)
122 (add-to-list 'ac-dictionary-directories
123 "/usr/pkg/share/emacs/site-lisp/auto-complete/ac-dict")
124 (mapcar (lambda (mode)
125 (add-to-list 'ac-modes mode))
130 (setq ac-modes (remove 'css-mode ac-modes))
131 (add-hook 'erlang-mode-hook
133 (add-to-list 'ac-sources 'ac-source-semantic)))
134 (ac-config-default)))
137 (require-if-present 'mic-paren)
138 (if (featurep 'mic-paren)
142 (load "elscreen" "ElScreen" t)
143 (require-if-present 'elscreen-w3m)
146 (require-if-present 'undo-tree)
147 (global-undo-tree-mode)
150 ;(require-if-present 'mpc-autoloads)
153 (autoload 'rst-mode "rst"
154 "mode for editing reStructuredText documents" t)
155 (setq auto-mode-alist
156 (append '(("\\.rst$" . rst-mode)
157 ("\\.rest$" . rst-mode)) auto-mode-alist))
160 (autoload 'lua-mode "lua-mode" "Lua editing mode." t)
161 (add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode) auto-mode-alist)
164 (require-if-present 'twittering-mode)
165 (setq twittering-username "phonohawk")
168 (load-file-if-present "/usr/pkg/share/emacs/site-lisp/cedet/common/cedet.el")
171 (autoload 'riece "riece" "Start Riece" t)
172 (add-hook 'riece-after-load-startup-hook
174 (add-to-list 'riece-addons 'riece-alias)
175 (add-to-list 'riece-addons 'riece-skk-kakutei)
176 (add-to-list 'riece-addons 'riece-keyword)
177 (add-to-list 'riece-addons 'riece-ctlseq)))
180 (require-if-present 'ecb-autoloads)
181 (let* ((hosts '(("netbsd." .
182 (("~/sandbox/yxmimeproc" "yxmimeproc")
183 ("~/sandbox/YxMIME" "YxMIME.pm")
186 (("~/sandbox/MR/engine/libycom" "libycom")
188 ("aria.cielonegro.org" .
189 (("~/sandbox/_web-app/Rakka" "Rakka")
190 ("~/sandbox/_haskell/Lucu" "Lucu")
191 ("~/sandbox/_web-app/Kirschbaum" "Kirschbaum")
192 ("~/sandbox/_haskell/HsOpenSSL" "HsOpenSSL")
193 ("~/sandbox/_haskell/HsHyperEstraier" "HsHyperEstraier")
194 ("~/sandbox/_haskell/HsSVN" "HsSVN")
195 ("~/sandbox/_game/RoRo" "RoRo")
196 ("~/sandbox/_haskell/HXT" "HXT")
197 ("~/sandbox/_haskell/hxt-compile" "hxt-compile")
198 ("~/src/ghc-6.10.1" "ghc-6.10.1")
199 ("~/sandbox/sugar" "sugar")
200 ("~/sandbox/_haskell/dns" "dns")
201 ("~/sandbox/_haskell/blackboard-ddns" "blackboard-ddns")
203 (paths (cdr (assoc (system-name) hosts))))
204 (setq ecb-source-path paths))
207 (require-if-present 'gaelic)
210 (autoload 'rnc-mode "rnc-mode")
211 (add-to-list 'auto-mode-alist '("\\.rnc\\'" . rnc-mode))
214 (setq bookmark-sort-flag nil)
217 (autoload 'sudoku "sudoku" "The Sudoku" t)
220 (autoload 'mew "mew" "Mew" t)
223 (autoload 'cleite "cleite" "Cleite RSS Aggregator -- Emacs Interface" t)
226 (autoload 'js2-mode "js2" nil t)
227 (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
234 (autoload 'sokoban "sokoban.el" "Start a new game of Sokoban." t)
235 (autoload 'sokoban-mode "sokoban.el" "Play Sokoban in current buffer." t)
236 (setq sokoban-playerfiles-dir "/usr/local/var/games/emacs-sokoban")
239 (load-file-if-present "/usr/pkg/share/emacs/site-lisp/nxml-mode/rng-auto.el")
240 (defalias 'xml-mode 'nxml-mode)
241 (add-to-list 'auto-mode-alist '("\\.xml$" . nxml-mode))
242 (add-to-list 'auto-mode-alist '("\\.xi$" . nxml-mode))
243 (add-to-list 'auto-mode-alist '("\\.rdf$" . nxml-mode))
244 (add-to-list 'auto-mode-alist '("\\.rng$" . nxml-mode))
247 (autoload 'sstp-mode "sstp" "SSTP Editing Major-Mode" t)
250 (autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files")
251 (setq auto-mode-alist
252 (append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
253 (setq interpreter-mode-alist (append '(("ruby" .ruby-mode))
254 interpreter-mode-alist))
255 (autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process")
256 (autoload 'inf-ruby-keys "inf-ruby" "set local key defs for inf-ruby in ruby-mode")
257 (add-hook 'ruby-mode-hook
263 (load-if-present "haskell-site-file.el")
265 (autoload 'run-haskell "inf-haskell" "" t)
266 (autoload 'switch-to-haskell "inf-haskell" "" t)
267 (autoload 'inferior-haskell-load-file "inf-haskell" "" t)
268 (autoload 'inferior-haskell-type "inf-haskell" "" t)
269 (autoload 'inferior-haskell-info "inf-haskell" "" t)
270 (autoload 'inferior-haskell-find-definition "inf-haskell" "" t)
271 (autoload 'inferior-haskell-find-haddock "inf-haskell" "" t)
274 (add-to-list 'auto-mode-alist '("\\.hs$" . haskell-mode))
275 (add-to-list 'auto-mode-alist '("\\.hsc$" . haskell-mode))
277 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
278 (add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
279 (add-hook 'haskell-mode-hook 'turn-on-haskell-ghci)
282 (autoload 'hoogle-lookup "hoogle" "Hoogle" t)
283 (global-set-key (kbd "C-c h") 'hoogle-lookup)
286 (mapcar (lambda (hook)
288 (lambda () (c-set-style "user"))))
295 (autoload 'css-mode "css-mode" "For editing CSS file" t)
296 (setq cssm-indent-level 4)
297 (setq cssm-mirror-mode nil)
298 (setq cssm-indent-function 'cssm-c-style-indenter)
299 (setq auto-mode-alist
301 '(("\\.css$" . css-mode))
305 (autoload 'emacs-wiki-find-file "emacs-wiki" "Emacs Wiki" t)
306 (defalias 'wiki 'emacs-wiki-find-file)
309 (defalias 'perl-mode 'cperl-mode)
310 (setq cperl-indent-level 4)
311 (setq cperl-indent-parens-as-block t)
314 (add-to-list 'load-path "/usr/pkg/lib/erlang/lib/tools-2.6/emacs")
315 (require-if-present 'erlang-start)
316 (setq erlang-electric-commands nil)
319 (require 'skk-autoloads)
320 (global-set-key "\C-x\C-j" 'skk-mode)
321 (global-set-key "\C-xj" 'skk-auto-fill-mode)
322 (global-set-key "\C-xt" 'skk-tutorial)
323 (setq skk-use-jisx0201-input-method t)
324 (setq skk-rom-kana-rule-list
326 ("wi" nil ("ヰ" . "ゐ"))
327 ("we" nil ("ヱ" . "ゑ"))
328 ;;("hh" "h" ("ン" . "ん"))
329 ;;("mm" "m" ("ン" . "ん"))
330 ("zx" nil ("ゝ" . "ヽ"))
331 ("zc" nil ("ゞ" . "ヾ"))))
332 (set-input-method 'japanese-skk) ; INPUT METHOD
335 (autoload 'navi2ch "navi2ch" "Navigator for 2ch for Emacs" t)
338 (require-if-present 'migemo)
341 (setq load-path (cons (expand-file-name "~/sandbox/Tiarra") load-path))
342 (autoload 'tiarra-conf-mode "tiarra-conf" "tiarra.conf editing mode" t)
345 (autoload 'po-mode "po-mode")
346 (setq auto-mode-alist
347 (cons '("\\.po[tx]?\\'\\|\\.po\\." . po-mode)
351 (setq user-full-name "PHO")
352 (setq user-mail-address "pho@cielonegro.org")
356 (add-change-log-entry nil (expand-file-name "~/sync/memo.txt")))
357 (define-key ctl-x-map "M" #'memo)
361 (add-change-log-entry nil (expand-file-name "~/sync/depression.txt")))
362 (define-key ctl-x-map "P" #'depression)
366 (add-change-log-entry nil (expand-file-name "~/sync/plant.txt")))
367 (define-key ctl-x-map "G" #'plant)
370 (add-hook 'calc-start-hook
372 (if (functionp 'paren-deactivate)
373 (paren-deactivate))))
374 (add-hook 'calc-end-hook
376 (if (functionp 'paren-activate)
380 (autoload 'w3m "w3m" "Interface for w3m on Emacs." t)
381 (autoload 'w3m-browse-url "w3m" "Browse url by w3m." t)
382 (autoload 'w3m-find-file "w3m" "w3m interface function for local file." t)
383 (autoload 'w3m-search "w3m-search" "Search QUERY using SEARCH-ENGINE." t)
384 (autoload 'w3m-weather "w3m-weather" "Display weather report." t)
385 (autoload 'w3m-antenna "w3m-antenna" "Report chenge of WEB sites." t)
386 (autoload 'w3m-namazu "w3m-namazu" "Search files with Namazu." t)
389 (autoload 'pov-mode "pov-mode" "POV-Ray scene file mode" t)
390 (setq auto-mode-alist
391 (append '(("\\.pov$" . pov-mode)
392 ("\\.inc$" . pov-mode)
395 ;; End of user configuration ---------------------------------------------------
398 (put 'narrow-to-region 'disabled nil)
399 (custom-set-variables
400 ;; custom-set-variables was added by Custom.
401 ;; If you edit it by hand, you could mess it up, so be careful.
402 ;; Your init file should contain only one such instance.
403 ;; If there is more than one, they won't work right.
404 '(Info-additional-directory-list (quote ("/sw/share/info" "/usr/local/info" "/usr/local/share/info")))
405 '(appt-display-format (quote window))
406 '(appt-message-warning-time 20)
407 '(canlock-password "a14fa4d2601465d55585c291fa8b3943e189e716")
408 '(cleite:auto-refresh-interval nil)
409 '(cleite:measure-srpc-call-time t)
410 '(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")))
411 '(cperl-merge-trailing-else nil)
412 '(default-frame-alist (quote ((tool-bar-lines . 0) (menu-bar-lines . 1) (width . 80) (height . 25) (right-fringe) (left-fringe))))
413 '(ecb-add-path-for-not-matching-files (quote (t)))
414 '(ecb-help-info-path "/sw/share/info/ecb.info")
415 '(ecb-layout-name "left14")
416 '(ecb-options-version "2.32")
417 '(ecb-show-sources-in-directories-buffer (quote always))
418 '(ecb-tip-of-the-day nil)
419 '(ecb-tree-buffer-style (quote ascii-guides))
420 '(ecb-windows-width 0.2)
421 '(elscreen-display-tab t)
422 '(haskell-program-name "ghci")
423 '(ido-enable-flex-matching t)
425 '(ido-ignore-files (quote ("\\`CVS/" "\\`#" "\\`.#" "\\`\\.\\./" "\\`\\./" "\\.ttc")))
426 '(ido-work-directory-list-ignore-regexps (quote ("^\\(/mnt/ibm/\\|/Volumes/IBM80GB/\\)")))
427 '(indent-tabs-mode nil)
428 '(jabber-nickname "PHO")
429 '(jabber-resource "emacs")
430 '(jabber-server "jabber.jp")
431 '(jabber-username "phonohawk")
432 '(jaspace-highlight-tabs t)
433 '(js2-auto-indent-flag nil)
434 '(js2-basic-offset 4)
435 '(js2-indent-on-enter-key nil)
436 '(js2-mirror-mode nil)
437 '(js2-use-font-lock-faces t)
438 '(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))))
439 '(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")))))
440 '(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")))
441 '(mew-spam: "X-Text-Classification:")
442 '(mew-summary-form (quote (type (5 date) " " (14 from) " " t (14 x-classification) " " (30 subj) "|" (0 body))))
443 '(mouse-wheel-progessive-speed nil)
444 '(mouse-wheel-scroll-amount (quote (1 ((shift) . 5) ((control)))))
445 '(navi2ch-browse-url-browser-function (quote browse-url-firefox))
446 '(navi2ch-display-splash-screen nil)
447 '(navi2ch-list-moved-board-alist (quote (("http://mamono.2ch.net/ihou/" . "http://hideyoshi.2ch.net/ihou/"))))
448 '(navi2ch-mona-face-variable (quote navi2ch-mona12-face))
449 '(navi2ch-mona-on-message-mode t)
450 '(newsticker-html-renderer (quote w3m-region))
451 '(newsticker-url-list nil)
452 '(newsticker-url-list-defaults (quote (("slashdot" "http://slashdot.org/index.rss" nil 3600))))
453 '(nxml-auto-insert-xml-declaration-flag t)
454 '(nxml-slash-auto-complete-flag t)
455 '(riece-layout "default")
456 '(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"))))
457 '(riece-others-buffer-mode nil)
458 '(rng-schema-locating-files (quote ("schemas.xml" "/sw/share/schema/schemas.xml" "~/share/nxml/schemas.xml")))
459 '(rst-level-face-base-light 50)
460 '(safe-local-variable-values (quote ((todo-categories "Todo" "Todo" "Todo" "Todo"))))
461 '(tramp-auto-save-directory "/tmp/tramp-auto-save")
462 '(tramp-completion-reread-directory-timeout 2)
463 '(tramp-default-host "localhost")
464 '(w3m-bookmark-file-coding-system (quote utf-8))
465 '(w3m-coding-system (quote utf-8))
466 '(w3m-coding-system-priority-list (quote (utf-8)))
467 '(w3m-default-coding-system (quote utf-8))
468 '(w3m-default-display-inline-images t)
469 '(w3m-file-coding-system (quote utf-8))
470 '(w3m-file-name-coding-system (quote utf-8))
471 '(w3m-fill-column 80)
472 '(w3m-input-coding-system (quote utf-8))
473 '(w3m-key-binding nil)
474 '(w3m-output-coding-system (quote utf-8))
475 '(w3m-terminal-coding-system (quote utf-8))
477 '(x-select-enable-clipboard t))
479 ;; custom-set-faces was added by Custom.
480 ;; If you edit it by hand, you could mess it up, so be careful.
481 ;; Your init file should contain only one such instance.
482 ;; If there is more than one, they won't work right.
483 '(flyspell-incorrect ((t (:foreground "OrangeRed" :overline t))))
484 '(jaspace-highlight-tab-face ((((class color) (background dark)) (:foreground "gray70" :underline t))))
485 '(which-func-face ((t (:background "black" :foreground "dark orange")))))