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