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