flat7th

# NTEmacs emacs-23.1-bin-i386 用の最新オレ設定

created 2009-10-06 modified 2009-10-29 

;; Are we running XEmacs or Emacs?
(defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))

;; Set up the keyboard so the delete key on both the regular keyboard
;; and the keypad delete the character under the cursor and to the right
;; under X, instead of the default, backspace behavior.
(global-set-key [delete] 'delete-char)
(global-set-key [kp-delete] 'delete-char)

;; Turn on font-lock mode for Emacs
(cond ((not running-xemacs)
       (global-font-lock-mode t)
))

;; Visual feedback on selections
(setq-default transient-mark-mode t)

;; Always end a file with a newline
(setq require-final-newline t)

;; Stop at the end of the file, not just add lines
(setq next-line-add-newlines nil)

;; Enable wheelmouse support by default
(cond (window-system
       (mwheel-install)
))

;; kuruma
(setq-default tab-width 4)

;;(set-default-coding-systems 'xxx)
;;(default-value 'buffer-file-coding-system) ;;japanese-shift-jis
;;default-buffer-file-coding-system
;;default-file-name-coding-system
;;default-keyboard-coding-system
;;default-process-coding-system
;;default-terminal-coding-system

;;(setq default-buffer-file-coding-system 'japanese-shift-jis) ;;'shift_jis
(setq default-buffer-file-coding-system 'japanese-iso-8bit-unix) ;;'euc-japan
;;(setq default-buffer-file-coding-system 'utf-8)

(progn
(define-key global-map "\C-z" 'undo)
(define-key global-map "\M-o" 'other-window)
(define-key global-map "\M-\C-o" 'other-frame)
(define-key global-map "\C-cg" 'goto-line)
;;(define-key global-map [zenkaku-hankaku] 'toggle-input-method)
;;(define-key global-map [zenkaku-hankaku] 'skk-mode)
;;(define-key skk-j-mode-map [henkan] 'skk-insert)
(define-key global-map "\C-xl" "\C-x#")
(define-key global-map "\M-:" 'kill-comment)
(define-key global-map "\M-[2~" 'overwrite-mode) ;; for PuTTY
(define-key global-map "\M-[3~" 'delete-char)    ;; for PuTTY
(define-key global-map "\M-[5~" (lambda () (interactive) (scroll-down 5)) ) ;; wheel
(define-key global-map "\M-[6~" (lambda () (interactive) (scroll-up 5)) ) ;; wheel
(defun toggle-dedicate () 
  "toggle dedicate status"
  (interactive)
  (let ((d (not (window-dedicated-p (selected-window)))))
    (set-window-dedicated-p (selected-window) d)
    (if d
	(message "dedicated.")
      (message "not dedicated."))
    ))
(define-key global-map [f1] 'toggle-dedicate)
(define-key global-map [(shift f1)] '(lambda () (interactive) (message "ahya!")))
(define-key global-map [f2] "\C-xe")
(define-key global-map [(shift f2)] '(lambda () (interactive) (insert (buffer-name))))
(define-key global-map [f3] "\C-x(")
(define-key global-map [f4] "\C-x)")
(define-key global-map [f5] 'toggle-truncate-lines)
(define-key global-map [f6] 'bury-buffer)
(define-key global-map [f7] '(lambda ()
			(interactive)
			(setq tab-width (- tab-width 1))
			(redraw-display)
			(message "tab-width = %d" tab-width)))
(define-key global-map [f8] '(lambda ()
			(interactive)
			(setq tab-width (+ tab-width 1))
			(redraw-display)
			(message "tab-width = %d" tab-width)))
(define-key global-map [f9] "\M--3\C-x^")
(define-key global-map [f10] "\M-3\C-x^")
(define-key global-map [f11] "\M-6\C-x{")
(define-key global-map [f12] "\M-6\C-x}")
)

(eval-after-load "dired"
  '(progn
     (fset 'dired-find-file-eucjp "\C-x\C-mceuc-japan\C-mf")
     (define-key dired-mode-map "e" 'dired-find-file-eucjp)
     ))

;;
(load-library "generic-x")

(setq auto-mode-alist
     (append '(("\\.h$" . c++-mode))
             auto-mode-alist))

;; (progn
;;   (require 'tramp)
;;   ;;(modify-coding-system-alist 'process "plink" 'utf-8-unix)
;;   (modify-coding-system-alist 'process "plink" 'euc-japan-unix)
;; ;;   (setq tramp-default-method "plink")
;; )

(eval-after-load "tramp"
  '(progn
	  (modify-coding-system-alist 'process "plink" 'euc-japan-unix)
     ))

(modify-coding-system-alist 'process "bash" 'shift_jis-unix)

;;
;; (utf-translate-cjk-mode 1)

;;
(setq directory-free-space-program nil)

;; frame title
;; hint: frame-title-format, icon-title-format
(setq frame-title-format
      ;;original... '(multiple-frames "%b" ("" invocation-name "@" system-name))
;;    '("[E] %b @" system-name ":" default-directory)
      '("[E] %b :" default-directory)
      )

;;
;; '(default-frame-alist (quote ((tool-bar-lines . 0) (menu-bar-lines . 0) (font . "lucidasanstypewriter-12")
;; (foreground-color . "white") (background-color . "gray20") (cursor-color . "red") (mouse-color . "red"))))


;;(create-fontset-from-ascii-font "Consolas 10" nil "u1")
(create-fontset-from-ascii-font "MS Gothic 9" nil "u1") ;;郷に入っては郷に従う
(set-fontset-font "fontset-u1" 'japanese-jisx0208
  '("MS Gothic" . "jisx0208-sjis"))
(set-fontset-font "fontset-u1" 'katakana-jisx0201
  '("MS Gothic" . "jisx0208-sjis"))
(set-fontset-font "fontset-u1" 'japanese-jisx0208-1978
  '("MS Gothic" . "jisx0208-sjis"))


;;'(c-offsets-alist
;; (quote
;;  ((inline-open . 0)
;;	(member-init-cont . c-lineup-dont-change)
;;	(substatement-open . 0)
;;	(case-label . +)
;;	(arglist-cont-nonempty . +)
;;	)))
;;'(c-offsets-alist (quote ((substatement-open . 0) (case-label . +))))

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
'(auto-compression-mode t nil (jka-compr))
'(auto-revert-interval 1)
'(backup-directory-alist (quote ((".*" . "~/.emacsbak"))))
'(c++-font-lock-extra-types (quote ("\\sw+_t" "\\([iof]\\|str\\)+stream\\(buf\\)?" "ios" "string" "rope" "list" "slist" "deque" "vector" "bit_vector" "set" "multiset" "map" "multimap" "hash\\(_\\(m\\(ap\\|ulti\\(map\\|set\\)\\)\\|set\\)\\)?" "stack" "queue" "priority_queue" "type_info" "iterator" "const_iterator" "reverse_iterator" "const_reverse_iterator" "reference" "const_reference" "u_?\\(int\\|long\\|short\\|char\\)")))
'(c-default-style (quote ((c-mode . "cc-mode") (c++-mode . "cc-mode") (java-mode . "java"))))
'(c-echo-syntactic-information-p t)
'(c-font-lock-extra-types (quote ("FILE" "\\sw+_t" "Lisp_Object" "u_?\\(int\\|long\\|short\\|char\\)")))
'(c-offsets-alist (quote ((substatement-open . 0) (case-label . +))))
'(c-tab-always-indent nil)
'(comint-scroll-to-bottom-on-input t)
'(default-frame-alist (quote ((menu-bar-lines . 1) (foreground-color . "white") (background-color . "gray20") (cursor-color . "red") (mouse-color . "red") (font . "-outline-ms ゴシック-normal-normal-normal-mono-*-90-*-*-c-*-fontset-u1") (width . 84) (height . 48))))
'(dired-dnd-protocol-alist (quote (("^file:///" . dnd-open-local-file) ("^file://" . dnd-open-file) ("^file:" . dnd-open-local-file))))
'(dired-listing-switches "-alog")
'(dired-recursive-copies t)
'(explicit-shell-file-name "d:/cygwin/bin/bash.exe")
'(generic-define-mswindows-modes t)
'(global-auto-revert-mode t nil (autorevert))
'(initial-frame-alist (quote ((tool-bar-lines . 0) (menu-bar-lines . 1))))
'(ls-lisp-verbosity nil)
'(revert-without-query (quote (".log$")))
'(same-window-buffer-names (quote ("*shell*" "*mail*" "*info*" "*inferior-lisp*" "*ielm*" "*scheme*" "*Buffer List*")))
'(same-window-regexps (quote ("\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)" "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)" "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)" "\\*gud-.*\\*\\(\\|<[0-9]+>\\)" "\\`\\*Customiz.*\\*\\'" "\\*Man .*\\*")))
'(scroll-step 1)
'(skk-egg-like-newline t)
'(tooltip-mode nil nil (tooltip))
'(tramp-default-method "plink")
'(tramp-password-prompt-regexp "^.*\\([pP]assword\\|[pP]assphrase\\|\\).*:.? *")
'(truncate-lines t)
'(woman-fill-frame t))

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
'(ediff-even-diff-face-Ancestor ((((class color)) (:background "Grey" :foreground "Blue"))))
'(ediff-even-diff-face-B ((((class color)) (:background "Grey" :foreground "Blue"))))
'(ediff-odd-diff-face-A ((((class color)) (:background "Grey" :foreground "Blue"))))
'(ediff-odd-diff-face-C ((((class color)) (:background "Grey" :foreground "Blue"))))
'(font-lock-comment-face ((((class color) (background dark)) (:foreground "forestgreen"))))
'(font-lock-function-name-face ((nil (:foreground "skyblue")))))

(put 'narrow-to-region 'disabled nil)


;;(server-start)