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