(let (apels sorted-path)
(while load-path
(let ((head (car load-path)))
(if (string-match "/apel" head)
(setq apels (cons head apels))
(setq sorted-path (cons head sorted-path)))
(setq load-path (cdr load-path))))
(setq load-path (append sorted-path apels)))
(setq load-path
(append (list
"~/lisp"
"~/lisp/emacs-wget"
"~/ucvs/share/emacs/site-lisp/apel"
"~/ucvs/share/emacs/site-lisp/emu"
"~/ucvs/share/emacs/site-lisp/flim"
"~/ucvs/share/emacs/site-lisp/semi"
"~/ucvs/share/emacs/site-lisp/wl"
"~/ucvs/share/emacs/site-lisp/mew"
"~/ucvs/share/emacs/site-lisp/w3m"
"~/ucvs/share/emacs/site-lisp/skk"
"~/ucvs/share/emacs/site-lisp/sdic"
"~/ucvs/share/emacs/site-lisp/ruby"
"~/ucvs/share/emacs/site-lisp"
)
load-path
(list
"/usr/local/share/emacs/site-lisp"
)
))
(load "my_lisp_private")
(setq user-full-name "Kenichi Kurihara")
(set-language-environment "Japanese")
(set-default-coding-systems 'euc-jp)
(prefer-coding-system 'euc-jp)
(if (eq system-type 'darwin)
(progn
(set-selection-coding-system 'shift_jis-mac)
(setq file-name-coding-system 'utf-8))
(setq file-name-coding-system 'euc-jp))
(set-terminal-coding-system 'euc-jp)
(setq default-process-coding-system (cons 'euc-jp 'euc-jp))
(when (fboundp 'utf-translate-cjk-mode)
(utf-translate-cjk-mode t)
)
(eval-after-load "subst-jis" '(load "subst-jisx0208ex"))
(if (not (eq system-type 'darwin))
(display-time))
(when (eq window-system 'mac)
(load "my_lisp_carbon-emacs"))
(global-unset-key "\C-q")
(global-set-key "\C-qh" 'help-command)
(global-set-key "\C-qsb" 'ispell-buffer)
(global-set-key "\C-qsw" (lambda ()
(interactive)
(ispell-word) (message "use M-$ instead.")))
(global-set-key "\C-qsr" 'ispell-region)
(global-set-key "\C-qc" 'cvs-examine)
(global-set-key "\M-\C-b" 'iswitchb-buffer)
(global-set-key "\C-o" 'dabbrev-expand)
(global-set-key "\M-\"" (lambda ()
(interactive)
(insert "\"\"")
(backward-char)))
(global-set-key "\M-u" (lambda () (interactive) (upcase-word -1)))
(global-set-key "\M-l" (lambda () (interactive) (downcase-word -1)))
(global-set-key "\C-x\M-f" 'find-file-other-window)
(global-set-key "\C-h" 'backward-delete-char-untabify)
(define-key isearch-mode-map "\C-h" 'isearch-delete-char)
(global-set-key [?\C-,] '(lambda () (interactive) (previous-line 15)))
(global-set-key [?\C-.] '(lambda () (interactive) (next-line 15)))
(global-set-key "\M-o" '(lambda () (interactive) (other-window 1)))
(global-set-key "\M-\C-o" '(lambda () (interactive) (other-window -1)))
(global-set-key [?\C-}] 'increase-left-margin)
(global-set-key [?\C-{] 'decrease-left-margin)
(when (and (not (eq window-system 'mac))
(eq system-type 'darwin))
(autoload 'paste-from-mac "my_lisp_lazy-loads" "paste from mac" t)
(autoload 'copy-to-mac "my_lisp_lazy-loads" "copy to mac" t)
(setq interprogram-cut-function 'copy-to-mac)
(global-set-key "\M-V" 'paste-from-mac))
(autoload 'my-concat-paragraph-en
"my_lisp_lazy-loads" "concat lines in the paragraph" t)
(global-set-key "\M-Q" 'my-concat-paragraph-en)
(server-start)
(if (eq window-system 'x)
(add-hook 'server-switch-hook 'raise-frame))
(eval-after-load "dabbrev" '(load "my_lisp_dabbrev.el"))
(setq
confirm-kill-emacs 'y-or-n-p
visible-bell t
max-lisp-eval-depth 1000
max-specpdl-size 3000
temporary-file-directory "~/tmp/"
completion-ignore-case t
read-file-name-completion-ignore-case t
ispell-dictionary "english"
ps-multibyte-buffer 'non-latin-printer
vc-follow-symlinks t
vc-cvs-stay-local nil
scroll-conservatively 100
inhibit-startup-message t
gc-cons-threshold 1000000
truncate-partial-width-windows nil
backup-inhibited t
completion-ignored-extensions (cons ".rtf" (remove ".dvi"
(remove ".pdf"
completion-ignored-extensions)))
browse-url-browser-function (cond ((eq system-type 'darwin)
'browse-url-default-macosx-browser)
(window-system 'w3m-browse-url)
(t 'w3m-browse-url))
redisplay-dont-pause t
line-number-display-limit-width 80000
auto-mode-alist (append
'(("\\.pl$" . prolog-mode)
("\\.plist$" . sgml-mode)
("\\.psm$" . prolog-mode) ("\\.zsh$" . shell-script-mode)
("\\.plt$" . gnuplot-mode)
("\\.m$" . matlab-mode)
)
auto-mode-alist) Info-additional-directory-list '("~/ucvs/info" "/sw/share/info")
compilation-scroll-output t
compilation-window-height 8
undo-no-redo t
)
(autoload 'find-file-as-su "my_lisp_lazy-loads" "find file as su" t)
(fset 'yes-or-no-p 'y-or-n-p)
(setq-default save-place t)
(require 'saveplace)
(add-hook 'after-save-hook
'executable-make-buffer-file-executable-if-script-p)
(when window-system
(let ((help-echo
"mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this"))
(setq mode-line-position
`((size-indication-mode
(8 ,(propertize " of %I" 'help-echo help-echo)))
(line-number-mode
((column-number-mode
(10 ,(propertize " (%l,%c)" 'help-echo help-echo))
(6 ,(propertize " L%l" 'help-echo help-echo))))
((column-number-mode
(5 ,(propertize " C%c" 'help-echo help-echo))))))))
(setq default-frame-alist
(append '((left-fringe . 0)
(right-fringe . 0))
default-frame-alist
'((foreground-color . "white")
(background-color . "#000000")
(mouse-color . "white")
(cursor-color . "yellow"))))
(setq initial-frame-alist default-frame-alist)
(setq frame-title-format "%b")
(set-face-foreground 'scroll-bar "dark orange")
(set-face-background 'fringe "gray15")
(set-face-foreground 'fringe "yellow")
(set-face-foreground 'tooltip "orange")
(set-face-background 'tooltip "black")
(set-face-attribute 'mode-line nil
:background "AntiqueWhite1"
:foreground "red4"
:box '(:line-width -1 :color "white")
)
(when (facep 'mode-line-inactive)
(set-face-attribute 'modeline-inactive nil
:inherit 'mode-line
:background "grey10"
:foreground "grey30"
:box '(:line-width -1 :color "grey")
)))
(defun dired-up-directory-after-kill ()
"Call 'dired-up-directory' after calling '(kill-buffer (current-buffer))'."
(interactive)
(let ((buf (current-buffer)))
(dired-up-directory)
(kill-buffer buf)))
(defun dired-advertised-find-file-after-kill ()
"Call 'dired-advertised-find-file' after calling '(kill-buffer (current-buffer))'."
(interactive)
(let ((buf (current-buffer)))
(dired-advertised-find-file)
(kill-buffer buf)))
(add-hook 'dired-load-hook
(require 'dired-x)
)
(defun my-dired-mode-hook-fun ()
(setq
dired-bind-jump nil
dired-bind-man nil
dired-bind-info nil
dired-guess-shell-alist-user
(remq nil
(list
(if (eq window-system 'mac)
(list "\\.\\(pdf\\|jpg\\|tiff\\|html\\|htm\\|eps\\)$" "open"))
(list "\\.tex$" "latex" "platex")
(list "\\.dvi$" "xdvi -display :0.0 ? &" "dvips" "dvipdfmx")
(list "\\.ps$" "open" "ps2pdf" "lpr")
))
dired-recursive-copies 'ask
dired-recursive-deletes 'ask
dired-listing-switches "-alh"
)
(set-face-foreground 'dired-marked "GreenYellow")
(define-key dired-mode-map "\M-o" nil) (define-key dired-mode-map "\M-^" 'dired-up-directory-after-kill)
(define-key dired-mode-map "\M-\C-m" 'dired-advertised-find-file-after-kill)
(define-key dired-mode-map "\C-co" 'dired-omit-mode)
(if (my-locate-file ".tex" (pwd))
(add-to-list 'dired-omit-extensions ".log")
(setq dired-omit-extensions (remove ".log" dired-omit-extensions)))
(dired-omit-mode 1) )
(defun my-locate-file (suffix dir)
(with-temp-buffer
(goto-char (point-min))
(call-process "ls" nil t t (expand-file-name dir))
(goto-char (point-min))
(search-forward-regexp (concat "^.*" suffix "$") (point-max) t)))
(add-hook 'dired-mode-hook
'my-dired-mode-hook-fun)
(require 'font-lock)
(global-font-lock-mode 1)
(add-hook 'font-lock-mode-hook
'(lambda ()
(set-face-foreground 'font-lock-builtin-face "violet")
(set-face-foreground 'font-lock-comment-face "#ff2222")
(set-face-foreground 'font-lock-string-face "sandy brown")
(set-face-foreground 'font-lock-keyword-face "skyblue")
(set-face-foreground 'font-lock-constant-face "dark orange")
(set-face-foreground 'font-lock-function-name-face "skyblue")
(set-face-foreground 'font-lock-variable-name-face "dark orange")
(set-face-foreground 'font-lock-type-face "LightSeaGreen")
(set-face-foreground 'font-lock-warning-face "skyblue")
(set-face-bold-p 'font-lock-function-name-face t)
(set-face-bold-p 'font-lock-warning-face nil)
))
(add-hook 'show-paren-mode-hook
(lambda ()
(set-face-background 'show-paren-match-face "DarkGoldenrod4")))
(add-hook 'find-file-hooks
(lambda ()
(show-paren-mode t)))
(setq abbrev-file-name "~/ucvs/etc/abbrev_defs"
save-abbrevs t)
(quietly-read-abbrev-file)
(blink-cursor-mode 0)
(menu-bar-mode 0)
(if window-system
(progn
(require 'highline)
(highline-mode)
(setq highline-face '((t (:background "#222222"))))
))
(add-hook 'find-file-hooks
(lambda ()
(if (or (memq major-mode '(change-log-mode))
(string-match "^makefile.*mode$" (prin1-to-string major-mode)))
(setq indent-tabs-mode t)
(setq indent-tabs-mode nil)) ))
(set-face-background 'region "RoyalBlue4")
(transient-mark-mode 1)
(setq mark-even-if-inactive t)
(eval-when-compile
(load "diff-mode"))
(add-hook 'diff-mode-hook
(lambda ()
(define-key diff-mode-map "\M-o" nil)))
(eval-after-load "bytecomp"
'(lambda ()
(setq byte-compile-warnings '(redefine callargs free-vars unresolved
obsolete cl-functions))))
(add-hook 'makefile-mode-hook
'(lambda ()
(define-key makefile-mode-map "\C-c\C-u" 'uncomment-region)))
(require 'session)
(add-hook 'after-init-hook 'session-initialize)
(require 'redo)
(define-key global-map "\C-\M-_" 'redo)
(autoload 'open "my_lisp_lazy-loads" "open a file with OSX native app" t)
(autoload 'physical-line-mode "physical-line" "" t)
(autoload 'gnuplot-mode "gnuplot" "" t)
(autoload 'ejr "my_lisp_lazy-loads" "C-u M-x w3m-search ejr" t)
(eval-when-compile
(require 'windows))
(defvar win:switch-prefix "\C-q\C-w")
(require 'windows)
(define-key global-map win:switch-prefix win:switch-map)
(define-key global-map "\C-xc" 'see-you-again)
(win:startup-with-window)
(setq win:use-frame nil)
(global-set-key "\C-q\C-s"
(lambda ()
(interactive)
(win:save-window win:current-config)))
(global-set-key "\C-q\C-r"
(lambda ()
(interactive)
(win-resume-menu)))
(eval-when-compile
(require 'wget))
(autoload 'wget "wget" "wget interface for Emacs." t)
(autoload 'wget-web-page "wget" "wget interface to download whole web page." t)
(add-hook 'wget-load-hook
(lambda ()
(load "w3m-wget")
(setq wget-basic-options '("-v"))))
(add-hook 'w3m-mode-hook
(lambda ()
(load "w3m-wget")))
(setq tramp-default-method "sshx"
tramp-verbose 5)
(require 'minibuf-isearch)
(setq minibuf-isearch-use-migemo nil
minibuf-isearch-treat-filecache nil)
(setq viper-custom-file-name "~/lisp/my_lisp_viper-custom.el"
viper-ESC-key "\e"
viper-mode t)
(require 'viper)
(when (facep 'viper-minibuffer-emacs)
(set-face-foreground 'viper-minibuffer-emacs "white")
(set-face-background 'viper-minibuffer-emacs "black"))
(setq viper-emacs-state-mode-list (append viper-emacs-state-mode-list
'(occur-mode
todo-mode
shell-mode
term-mode
wl-folder-mode
wl-summary-mode
wl-template-mode
))
viper-vi-state-mode-list (append viper-vi-state-mode-list
'(wl-draft-mode
apropos-mode
)))
(define-key viper-insert-basic-map "\C-d" 'delete-char)
(add-hook 'viper-vi-state-hook
'(lambda ()
(setq viper-vi-state-cursor-color "dark orange")
))
(add-hook 'viper-emacs-state-hook
'(lambda ()
(set-cursor-color "yellow")
))
(viper-harness-minor-mode "mime-edit")
(viper-harness-minor-mode "abbrev")
(iswitchb-mode 1)
(iswitchb-default-keybindings)
(setq iswitchb-default-method 'samewindow)
(eval-when-compile (require 'ruby-mode))
(autoload 'ruby-mode "ruby-mode"
"Mode for editing ruby source files" t)
(setq auto-mode-alist
(append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
(add-hook 'ruby-mode-hook
(lambda ()
(flyspell-prog-mode)
(define-key ruby-mode-map "\C-c\C-c" 'comment-region)
(define-key ruby-mode-map "\C-c\C-u" 'uncomment-region)))
(require 'mmm-auto)
(setq mmm-global-mode 'maybe)
(set-face-background 'mmm-default-submode-face nil) (mmm-add-classes
'((embedded-css
:submode css-mode
:front-offset 2
:front "<style\[^>\]*>"
:back "</style>")))
(mmm-add-classes
'((embedded-js
:submode javascript-mode
:front-offset 0
:front "<script\[^>\]*>"
:back "</script>")))
(mmm-add-mode-ext-class nil "\\.html\\'" 'embedded-css)
(mmm-add-mode-ext-class nil "\\.xml\\'" 'embedded-css)
(mmm-add-mode-ext-class nil "\\.html\\'" 'embedded-js)
(mmm-add-mode-ext-class nil "\\.xml\\'" 'embedded-js)
(add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode))
(autoload 'javascript-mode "javascript" nil t)
(setq javascript-indent-level 2
javascript-auto-indent-flag nil)
(add-hook 'javascript-mode-hook
(lambda ()
(flyspell-prog-mode)
(define-key javascript-mode-map "\C-c\C-c" 'comment-region)
(define-key javascript-mode-map "\C-c\C-u" 'uncomment-region)))
(add-to-list 'auto-mode-alist '("\\.css\\'" . css-mode))
(autoload 'css-mode "css-mode" nil t)
(add-hook 'css-mode-hook
(lambda ()
(flyspell-prog-mode)
(define-key css-mode-map "\C-c\C-c" 'comment-region)
(define-key css-mode-map "\C-c\C-u" 'uncomment-region)))
(eval-when-compile (require 'time-stamp))
(setq time-stamp-active nil
time-stamp-start "\\(last update : Nov. 27, 2007\\|Last Update: \\|最終更新日: \\)"
time-stamp-line-limit 10000
time-stamp-format "%3b. %02d, %04y"
time-stamp-end "\\(</\\|\n\\)"
system-time-locale "C")
(add-hook 'html-mode-hook
'(lambda ()
(flyspell-mode)
(define-key html-mode-map "\C-c\C-c" 'comment-region)
(define-key html-mode-map "\C-c\C-u" 'uncomment-region)
(make-variable-buffer-local 'time-stamp-active)
(setq time-stamp-active t)))
(add-hook 'write-file-hooks
(lambda () (if (eq major-mode 'html-mode) (time-stamp))))
(add-hook 'sgml-mode-hook
'(lambda ()
(flyspell-mode)
(define-key sgml-mode-map "\C-c\C-c" 'comment-region)
(define-key sgml-mode-map "\C-c\C-u" 'uncomment-region)
))
(add-hook 'sh-mode-hook
'(lambda ()
(flyspell-prog-mode)
(define-key sh-mode-map "\C-c\C-c" 'comment-region)
(define-key sh-mode-map "\C-c\C-u" 'uncomment-region)))
(autoload 'shell-new "my_lisp_shell")
(eval-after-load "shell"
'(require 'my_lisp_shell))
(autoload 'todo "my_lisp_lazy-loads" "todo" t)
(add-hook 'emacs-lisp-mode-hook
'(lambda ()
(require 'my_lisp_elisp)
(unless (eq major-mode 'lisp-interaction-mode)
(flyspell-prog-mode))
))
(eval-when-compile
(require 'my_lisp_cc-mode))
(autoload 'my-c-mode-common-hook "my_lisp_cc-mode")
(add-hook 'c-mode-common-hook
(lambda ()
(my-c-mode-common-hook)
))
(autoload 'wl "wl" "Wanderlust" t)
(autoload 'wl-draft "wl-draft" "Write draft with Wanderlust." t)
(autoload 'wl-user-agent-compose "wl-draft" nil t)
(define-mail-user-agent
'wl-user-agent
'wl-user-agent-compose
'wl-draft-send
'wl-draft-kill
'mail-send-hook)
(setq mail-user-agent 'wl-user-agent
wl-icon-directory "~/ucvs/share/emacs/21.3/etc/wl"
wl-address-file "~/lisp/addresses"
wl-folders-file "~/lisp/folders"
wl-init-file "my_lisp_wl")
(eval-when-compile
(require 'skk-autoloads)
(require 'skk)
(require 'my_lisp_skk))
(defvar skk-isearch-switch nil)
(global-set-key "\C-x\C-j"
(lambda ()
(interactive)
(require 'skk-autoloads)
(skk-mode)))
(setq skk-init-file "my_lisp_skk")
(autoload 'sdic-describe-word "sdic" "英単語の意味を調べる" t nil)
(autoload 'sdic-describe-word-at-point "sdic"
"カーソルの位置の英単語の意味を調べる" t nil)
(global-set-key "\C-qw" 'sdic-describe-word)
(eval-after-load "sdic"
'(load "my_lisp_sdic"))
(autoload 'word-count-mode "word-count"
"Minor mode to count words." t nil)
(global-set-key "\M-+" 'word-count-mode)
(eval-when-compile
(require 'my_lisp_term))
(autoload 'my-term-advice "my_lisp_term")
(autoload 'my-term-init "my_lisp_term")
(autoload 'my-term-eval-after-load "my_lisp_term")
(eval-after-load "term" '(my-term-eval-after-load))
(add-hook 'term-load-hook
(lambda ()
(my-term-init)))
(defadvice term (after my-term-init activate)
(my-term-advice))
(global-set-key "\C-q\C-t" 'term)
(autoload 'w3m "w3m" "Interface for w3m on Emacs." t)
(autoload 'w3m-find-file "w3m" "w3m interface function for local file." t)
(autoload 'w3m-browse-url "w3m" "Ask a WWW browser to show a URL." t)
(autoload 'w3m-search "w3m-search" "Search QUERY using SEARCH-ENGINE." t)
(autoload 'w3m-namazu "w3m-namazu" "Search indexed files with Namazu." t)
(eval-after-load "w3m"
'(require 'my_lisp_w3m))
(autoload 'octet-find-file "octet" "open octet files" t)
(eval-after-load "octet"
'(progn
(require 'w3m)
(setq octet-suffix-type-alist (append '(("rtf" . rtf))
octet-suffix-type-alist)
octet-type-filter-alist (append '((rtf octet-filter-call1
"unrtf" () html-u8))
octet-type-filter-alist)
)))
(eval-when-compile (require 'tex-mode))
(add-hook 'tex-mode-hook
(lambda ()
(flyspell-mode)
(setq font-lock-maximum-decoration
'((tex-mode . 2) (latex-mode . 2) (t . t)))
(define-key tex-mode-map "\C-cc" 'compile)
(define-key tex-mode-map "\C-c\C-j" 'xdvi-jump-to-line)
(define-key tex-mode-map "\C-c\C-c" 'comment-region)
(define-key tex-mode-map "\C-c\C-u" 'uncomment-region)
(require 'xdvi-search) (setq xdvi-version-number 22040000)
(when (eq window-system 'mac)
(setq xdvi-display "-display :0.0"))
(unless server-process
(server-start)) ))
(eval-after-load "prolog"
'(progn
(define-key prolog-mode-map "\C-c\C-c" 'comment-region)
(define-key prolog-mode-map "\C-c\C-u" 'uncomment-region)))
(eval-when-compile (require 'htmlize))
(setq htmlize-output-type 'css)
(autoload 'htmlize-buffer "htmlize" "make a html file from the buffer" t)
(when (locate-library "migemo")
(setq migemo-directory "~/ucvs/share/migemo")
(load "migemo")
(autoload 'my-interactive-migemo-toggle "my_lisp_lazy-loads" "toggle migemo" t)
(global-set-key "\C-qm" 'my-interactive-migemo-toggle)
(setq
migemo-use-pattern-alist nil
migemo-use-frequent-pattern-alist nil
migemo-pattern-alist-length 1024
migemo-isearch-min-length 2)
)
(autoload 'matlab-mode "matlab" "Enter Matlab mode." t)
(eval-after-load "matlab"
'(progn
(setq matlab-auto-fill nil
matlab-indent-level 2
)
(define-key matlab-mode-map "\C-c\C-c" 'comment-region)
(define-key matlab-mode-map "\C-c\C-u" 'uncomment-region)))
(add-hook 'matlab-mode-hook 'flyspell-prog-mode)