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