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