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