.emacs

;;;; -*- mode: lisp-interaction; syntax: elisp; coding: iso-2022-7bit -*-
;;;;
;;;; Copyright (C) 2001 The Meadow Team

;; Author: Koichiro Ohba
;; Kyotaro HORIGUCHI
;; Hideyuki SHIRAI
;; KOSEKI Yoshinori
;; and The Meadow Team.


;; ;;; Mule-UCS の設定
;; ;; ftp://ftp.m17n.org/pub/mule/Mule-UCS/
;; ;; (set-language-environment) の前に設定します
;; (require 'un-define)
;; (setq bitmap-alterable-charset 'tibetan-1-column)
;; (require 'jisx0213)

;; cygwin-mount.el
(require 'cygwin-mount)
(cygwin-mount-activate)

;;; 日本語環境設定
(set-language-environment "Japanese")


;;; IMEの設定
(mw32-ime-initialize)
(setq default-input-method "MW32-IME")
(setq-default mw32-ime-mode-line-state-indicator "[--]")
(setq mw32-ime-mode-line-state-indicator-list '("[--]" "[あ]" "[--]"))
(add-hook 'mw32-ime-on-hook
(function (lambda () (set-cursor-height 2))))
(add-hook 'mw32-ime-off-hook
(function (lambda () (set-cursor-height 4))))

;; enable-BackSpace
(load "term/bobcat")
(global-set-key "\C-h" 'delete-backward-char)

;; ;;; カーソルの設定
;; ;; (set-cursor-type 'box) ; Meadow-1.10互換 (SKK等で色が変る設定)
;; ;; (set-cursor-type 'hairline-caret) ; 縦棒キャレット


;;; マウスカーソルを消す設定
(setq w32-hide-mouse-on-key t)
(setq w32-hide-mouse-timeout 5000)


;;; ツールバーを表示しない
(tool-bar-mode 0)


;;; font-lockの設定
(global-font-lock-mode t)

;; フォント設定
(when (require 'font-setup nil t)
(setq font-setup-bdf-dir
(expand-file-name "../../fonts/intlfonts" data-directory))
(defun font-setup-small (&optional font num unuse set)
(interactive)
(let *1
(n (or num font-setup-ttf-def-number))
(dir (expand-file-name font-setup-bdf-dir))
fs min
(num 2) (size -14))
(setq min (or font-setup-bdf-hangul-mincho
(string-match "明朝\\|mincho" fn)))

(while (not (= num 0))
(if (= num 1)
(setq size -12))
(setq fs
(or set
(concat fn (int-to-string size))))
(w32-add-font
fs
`*2
*3
*4
*5
*6
*7
*8
;; '*9
;; default-frame-alist))


;; ;;; TrueType フォント設定
;; (w32-add-font
;; "private-fontset"
;; '*10
;; *11
;; *12
;; *13
;; *14
;; *15
;; *16
;; *17
;; *18
;; *19
;; *20
default-frame-alist))


;; ;;; setting shell

;; ;;; Cygwinbash を使う場合
(setq explicit-shell-file-name "bash.exe")
(setq shell-file-name "sh.exe")
(setq shell-command-switch "-c")

;; shell のコマンドの後に ^M が付加されてしまう問題の解決
(modify-coding-system-alist 'process ".*sh\\.exe" '(undecided-dos . undecided-unix))

;;; argument-editing の設定
(require 'mw32script)
(mw32script-init)


;; ;;; browse-url の設定
;; (global-set-key [S-mouse-2] 'browse-url-at-mouse)


;; ;;; 印刷の設定
;; ;; この設定で M-x print-buffer RET などでの印刷ができるようになります
;; ;;
;; ;; notepad に与えるパラメータの形式の設定
;; (define-process-argument-editing "notepad"
;; (lambda (x) (general-process-argument-editing-function x nil t)))
;;
;; (defun w32-print-region (start end
;; &optional lpr-prog delete-text buf display
;; &rest rest)
;; (interactive)
;; (let *21
;; (while (string-match "[/\\]" tmpfile)
;; (setq tmpfile (replace-match "_" t nil tmpfile)))
;; (setq tmpfile (expand-file-name (concat "_" tmpfile "_")
;; temporary-file-directory))
;; (write-region start end tmpfile nil 'nomsg)
;; (call-process "notepad" nil nil nil "/p" tmpfile)
;; (and (file-readable-p tmpfile) (file-writable-p tmpfile)
;; (delete-file tmpfile))))
;;
;; (setq print-region-function 'w32-print-region)

;;
;;RUBY の設定
;;

(setq auto-mode-alist
(cons (cons "\\.rb$" 'ruby-mode) auto-mode-alist))
(autoload 'ruby-mode "ruby-mode" "Mode for editing ruby sources" t)

;; CGIruby-mode で編集する
(setq auto-mode-alist
(cons (cons "\\.cgi$" 'ruby-mode) auto-mode-alist))
(autoload 'ruby-mode "ruby-mode" "Mode for editing CGI sources" t)

;;; YaTeX

(setq auto-mode-alist
(cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
(autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t)

(setq load-path (cons (expand-file-name "/usr/local/Meadow/site-lisp/yatex") load-path))

;; C#
(setq auto-mode-alist
(cons (cons "\\.cs$" 'csharp-mode) auto-mode-alist))
(autoload 'csharp-mode "csharp-mode" "Mode for editing csharp sources" t)



;;; line-number and column number
(defvar display-column-format '("(" current-column ",%l)--")
"Format for displaying the column in the mode line.
See documentation for `mode-line-format'. Must be set before
`column.el' is loaded.")
(autoload 'display-column-mode "column" nil t)
(display-column-mode 1)
(line-number-mode nil)


;; 画像ファイルを表示
;; find-file で画像が見れます
(auto-image-file-mode)

;; isearch ですぐにハイライトする
(setq isearch-lazy-highlight-initial-delay 0)

;;行間を調節
(setq-default line-spacing 1)

;;以下は追加された項目などのメモ
;;行末のスペースを強調表示.ただし,バッファローカル
(setq-default show-trailing-whitespace t)
;;;
;;; end of file
;;;
(custom-set-variables
;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
'(case-fold-search t)
'(current-language-environment "Japanese")
'(default-input-method "japanese")
'(global-font-lock-mode t nil (font-lock)))
(custom-set-faces
;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
)

;C-mode-comment
(defun c-begin-comment-box ()
"insert comment-beginning"
(interactive)
(insert "/**************************************\n")
)
(defun c-end-comment-box ()
"insert commment-end"
(interactive)
(insert "**************************************/\n")
)

(add-hook 'c-mode-hook
'(lambda()
(define-key c-mode-map "\C-cb" 'c-begin-comment-box)
(define-key c-mode-map "\C-ce" 'c-end-comment-box)
)
)

;; 背景色の設定
(set-face-foreground 'region "black")
(set-face-background 'region "SkyBlue")
(if (boundp 'window-system)
(setq initial-frame-alist
(append (list
'(foreground-color . "black") ;; 文字が白
'(background-color . "snow") ;; 背景は黒
'(border-color . "black")
'(mouse-color . "white")
'(cursor-color . "black")
'(cursor-type . box)
'(menu-bar-lines . 1)
;;15.2 フォントの設定 (2005/05/06) で設定したフォントを使用
;;'(font . "my-fontset")
;; 東雲なら shinonome16-fontset などを指定
'(vertical-scroll-bars . nil) ;;スクロールバーはいらない
'(width . 90) ;; ウィンドウ幅
'(height . 40) ;; ウィンドウの高さ
'(top . 0) ;;表示位置
'(left . 0) ;;表示位置
)
initial-frame-alist)))
;;(setq default-frame-alist initial-frame-alist)

;;C-mode setting
;; specify places where personal elisp files are stored
(setq load-path (cons (expand-file-name "~hig/usr/lib/elisp") load-path))

;; rebind keys in java mode
(add-hook 'java-mode-hook
(function (lambda ()
; start compilation with contol-c control-c
(define-key java-mode-map "\C-c\C-c" 'compile)
; comment out region with contol-c ;
(define-key java-mode-map "\C-c;" 'comment-region)
)))

;; jump to next error with control-x x
(global-set-key "\C-xx" 'next-error)


;; specify coding system for interacting with shells
(setq process-coding-system-alist '*22 auto-mode-alist))

;; color keywords appropriately in each mode
(global-font-lock-mode 1)

;; 折り返しの設定
(setq-default truncate-lines t)
(setq-default truncate-partial-width-windows t)


link cygwin-mount.el
http://www.ysnb.net/meadow/meadow-users-jp/1999/msg00114.html

*1:fn (or font font-setup-ttf-def

*2:spec ;; **TrueType Fonts** ;; ascii ((:char-spec ascii :height any) strict (w32-logfont ,fn 0 ,size 400 0 nil nil nil 0 1 3 ,n

*3::char-spec ascii :height any :weight bold) strict (w32-logfont ,fn 0 ,size 700 0 nil nil nil 0 1 3 ,n) ((spacing . -1))) ((:char-spec ascii :height any :weight normal :slant italic) strict (w32-logfont ,fn 0 ,size 400 0 t nil nil 0 1 3 ,n

*4::char-spec ascii :height any :weight bold :slant italic) strict (w32-logfont ,fn 0 ,size 700 0 t nil nil 0 1 3 ,n) ((spacing . -1))) ;; katakana-jisx0201 ((:char-spec katakana-jisx0201 :height any) strict (w32-logfont ,fn 0 ,size 400 0 nil nil nil 128 1 3 ,n

*5::char-spec katakana-jisx0201 :height any :weight bold) strict (w32-logfont ,fn 0 ,size 700 0 nil nil nil 128 1 3 ,n) ((spacing . -1))) ((:char-spec katakana-jisx0201 :height any :weight normal :slant italic) strict (w32-logfont ,fn 0 ,size 400 0 t nil nil 128 1 3 ,n

*6::char-spec katakana-jisx0201 :height any :weight bold :slant italic) strict (w32-logfont ,fn 0 ,size 700 0 t nil nil 128 1 3 ,n) ((spacing . -1))) ;; japanese-jisx0208 ((:char-spec japanese-jisx0208 :height any) strict (w32-logfont ,fn 0 ,size 400 0 nil nil nil 128 1 3 ,n

*7::char-spec japanese-jisx0208 :height any :weight bold) strict (w32-logfont ,fn 0 ,size 700 0 nil nil nil 128 1 3 ,n) ((spacing . -1))) ((:char-spec japanese-jisx0208 :height any :weight normal :slant italic) strict (w32-logfont ,fn 0 ,size 400 0 t nil nil 128 1 3 ,n

*8::char-spec japanese-jisx0208 :height any :weight bold :slant italic) strict (w32-logfont ,fn 0 ,size 700 0 t nil nil 128 1 3 ,n) ((spacing . -1)))))) ;; その他 (setq scalable-fonts-allowed t) (setq num (- num 1))))) (font-setup "MS ゴシック" 49 t) (font-setup "MS 明朝" 17 t) (font-setup-small "MS ゴシック" 49 t) (font-setup-small "MS 明朝" 17 t) ;; IME の Font (add-to-list 'default-frame-alist `(ime-font w32-logfont "MS ゴシック" 0 0 400 0 nil nil nil 128 1 3 49))) ;;(create-fontset-from-request "private-fontset" ;; '((width . 8) ;; (height . 16) ;; (fixed . t) ;; (italic . nil

*9:family . "MS ゴシック") ;; (family . "Courier New"))) ;; (setq default-frame-alist ;; (append (list '(font . "private-fontset"

*10:spec ;; ((:char-spec ascii :height 120) ;; strict ;; (w32-logfont "Courier New" 0 -13 400 0 nil nil nil 0 1 3 49

*11::char-spec ascii :height 120 :weight bold) ;; strict ;; (w32-logfont "Courier New" 0 -13 700 0 nil nil nil 0 1 3 49

*12::char-spec ascii :height 120 :slant italic) ;; strict ;; (w32-logfont "Courier New" 0 -13 400 0 t nil nil 0 1 3 49

*13::char-spec ascii :height 120 :weight bold :slant italic) ;; strict ;; (w32-logfont "Courier New" 0 -13 700 0 t nil nil 0 1 3 49

*14::char-spec japanese-jisx0208 :height 120) ;; strict ;; (w32-logfont "MS ゴシック" 0 -16 400 0 nil nil nil 128 1 3 49

*15::char-spec japanese-jisx0208 :height 120 :weight bold) ;; strict ;; (w32-logfont "MS ゴシック" 0 -16 700 0 nil nil nil 128 1 3 49) ;; ((spacing . -1))) ;; ((:char-spec japanese-jisx0208 :height 120 :slant italic) ;; strict ;; (w32-logfont "MS ゴシック" 0 -16 400 0 t nil nil 128 1 3 49

*16::char-spec japanese-jisx0208 :height 120 :weight bold :slant italic) ;; strict ;; (w32-logfont "MS ゴシック" 0 -16 700 0 t nil nil 128 1 3 49) ;; ((spacing . -1)))))) ;; (set-face-attribute 'variable-pitch nil :family "*") ;; ;;; BDF フォント設定 ;; ;; ;;; (方法その1) Netinstall パッケージを使う方法 ;; ;;; misc と intlfonts パッケージを入れます。 ;; ;;; .emacsの設定 ;; (setq bdf-use-intlfonts16 t) ;; (setq initial-frame-alist '((font . "intlfonts16"))) ;; ;; ;;; (方法その1') ;; ;;; intlfonts-file-16dot-alist の形式で bdf-fontset-alist を書き、 ;; ;;; 次を設定すれば良い。 ;; ;;; (require 'bdf) ;; ;;; (bdf-configure-fontset "bdf-fontset" bdf-fontset-alist) ;; ;;; 詳細は $MEADOW/pkginfo/auto-autoloads.el と $MEADOW/site-lisp/bdf.el を ;; ;;; 参照のこと。 ;; ;; ;;; (方法その2) ;; ;;; フォントの指定方法は次のサンプルを参考にする。 ;; ;;; normal, bold, italic, bold-itaric フォントを指定する必要あり。 ;; (setq bdf-font-directory "c:/Meadow/fonts/intlfonts/") ;; (w32-add-font "bdf-fontset" ;; `((spec ;; ;; ascii ;; ((:char-spec ascii :height any :weight normal :slant normal) ;; strict (bdf-font ,(expand-file-name "lt1-16-etl.bdf" bdf-font-directory))) ;; ((:char-spec ascii :height any :weight bold :slant normal) ;; strict (bdf-font ,(expand-file-name "lt1-16b-etl.bdf" bdf-font-directory))) ;; ((:char-spec ascii :height any :weight normal :slant any) ;; strict (bdf-font ,(expand-file-name "lt1-16i-etl.bdf" bdf-font-directory))) ;; ((:char-spec ascii :height any :weight bold :slant any) ;; strict (bdf-font ,(expand-file-name "lt1-16bi-etl.bdf" bdf-font-directory))) ;; ;; katakana-jisx0201 ;; ((:char-spec katakana-jisx0201 :height any :weight normal :slant normal) ;; strict (bdf-font ,(expand-file-name "8x16rk.bdf" bdf-font-directory

*17:encoding . 1-byte-set-msb))) ;; ((:char-spec katakana-jisx0201 :height any :weight bold :slant normal) ;; strict (bdf-font ,(expand-file-name "8x16rk.bdf" bdf-font-directory

*18:encoding . 1-byte-set-msb))) ;; ((:char-spec katakana-jisx0201 :height any :weight normal :slant any) ;; strict (bdf-font ,(expand-file-name "8x16rk.bdf" bdf-font-directory

*19:encoding . 1-byte-set-msb))) ;; ((:char-spec katakana-jisx0201 :height any :weight bold :slant any) ;; strict (bdf-font ,(expand-file-name "8x16rk.bdf" bdf-font-directory

*20:encoding . 1-byte-set-msb))) ;; ;; latin-jisx0201 ;; ((:char-spec latin-jisx0201 :height any :weight normal :slant normal) ;; strict (bdf-font ,(expand-file-name "8x16rk.bdf" bdf-font-directory))) ;; ((:char-spec latin-jisx0201 :height any :weight bold :slant normal) ;; strict (bdf-font ,(expand-file-name "8x16rk.bdf" bdf-font-directory))) ;; ((:char-spec latin-jisx0201 :height any :weight normal :slant any) ;; strict (bdf-font ,(expand-file-name "8x16rk.bdf" bdf-font-directory))) ;; ((:char-spec latin-jisx0201 :height any :weight bold :slant any) ;; strict (bdf-font ,(expand-file-name "8x16rk.bdf" bdf-font-directory))) ;; ;; japanese-jisx0208 ;; ((:char-spec japanese-jisx0208 :height any :weight normal :slant normal) ;; strict (bdf-font ,(expand-file-name "j90-16.bdf" bdf-font-directory))) ;; ((:char-spec japanese-jisx0208 :height any :weight bold :slant normal) ;; strict (bdf-font ,(expand-file-name "j90-16.bdf" bdf-font-directory))) ;; ((:char-spec japanese-jisx0208 :height any :weight normal :slant any) ;; strict (bdf-font ,(expand-file-name "j90-16.bdf" bdf-font-directory))) ;; ((:char-spec japanese-jisx0208 :height any :weight bold :slant any) ;; strict (bdf-font ,(expand-file-name "j90-16b.bdf" bdf-font-directory)))))) ;; 初期フレームの設定 (setq default-frame-alist (append (list '(foreground-color . "black") '(background-color . "LemonChiffon") '(background-color . "gray") '(border-color . "black") '(mouse-color . "white") '(cursor-color . "black") '(width . 80) '(height . 40) '(top . 10) '(left . 10

*21:tmpfile (convert-standard-filename (buffer-name))) ;; (w32-start-process-show-window t) ;; ;; もし、dos 窓が見えていやな人は上記の `t' を `nil' にします ;; ;; ただし、`nil' にすると Meadow が固まる環境もあるかもしれません ;; (coding-system-for-write w32-system-coding-system

*22: "bash" . euc-jp) ( "csh" . euc-jp) ( "tcsh" . euc-jp))) ;; user gnuplot-mode. elisp files are in ~hig/usr/lib/elisp (autoload 'gnuplot-mode "gnuplot" "gnuplot major mode" t) (autoload 'gnuplot-make-buffer "gnuplot" "open a buffer in gnuplot mode" t) (setq auto-mode-alist (append '(("\\.plt$" . gnuplot-mode