;; Red Hat Linux default .emacs initialization file

;; 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)
))

;;Enable mew
;; .emacs.el for mew
(autoload 'mew "mew" nil t)
(autoload 'mew-send "mew" nil t)
(setq mew-mail-domain-list
            '("flex.phys.tohoku.ac.jp"))

;; F3 de mew kidou
(global-set-key [f3] 'mew)

;; C-x r de mew kidou
(global-set-key "\C-xr" 'mew)

;; C-x m de mew-send kidou
(global-set-key "\C-xm" 'mew-send)


; 自動的にシグネチャをつける
(setq mew-signature-insert-last t)
;; Summary モードなどで新しいメッセージ作成用 dradt を作成したとき
(add-hook 'mew-draft-mode-newdraft-hook
   '(lambda ()
    (mew-draft-insert-signature)
    (insert "\n")
    (next-line -1)
))

;;; auto defined with Setup_wnn7egg script ------------------
(if (featurep 'xemacs)
(setq load-path (append '("/usr/share/wnn7/elisp/xemacs21") load-path))
(setq load-path (append '("/usr/share/wnn7/elisp/emacs20") load-path)))
(global-set-key "\C-\\" 'toggle-input-method)
(load "wnn7egg-leim")
(if (featurep 'xemacs)
(select-input-method "japanese-egg-wnn7")
(set-input-method "japanese-egg-wnn7"))
(set-language-info "Japanese" 'input-method "japanese-egg-wnn7")