Friday, February 26, 2010

current .emacs file

;;----------Load-path:ダウンロードした .el ファイルをロードする-----------
(setq load-path (cons "/usr/local/share/emacs/emacslisp" load-path))
(setq load-path (cons "/usr/local/share/emacs/emacslisp/yatex1.74" load-path))
;;--------------------------------------------------
(setq default-frame-alist
      '((background-color . "gray16")
(foreground-color . "white")
(width . 100)
(height . 40)
(top . 0)
(left . 0)
(line-spacing . 2)))
;;--------------------------------------------------
;; C-x bでミニバッファにバッファ候補を表示
(iswitchb-mode t)
(iswitchb-default-keybindings)
;;--------------------------------------------------
;; shell-pop
;; C-tでshellをポップアップ
(require 'shell-pop)
(shell-pop-set-internal-mode "ansi-term") ;; ansi-termを使うよ
(shell-pop-set-internal-mode-shell "/bin/bash") ;; bashを使うよ
(defvar ansi-term-after-hook nil)
(add-hook 'ansi-term-after-hook
          '(lambda ()
             (define-key term-raw-map "\C-t" 'shell-pop)))
(defadvice ansi-term (after ansi-term-after-advice (org))
  "run hook as after advice"
  (run-hooks 'ansi-term-after-hook))
(ad-activate 'ansi-term)
(global-set-key "\C-t" 'shell-pop)
;;--------------------------------------------------
;;; *.~ とかのバックアップファイルを作らない
(setq make-backup-files nil)
;;; .#* とかのバックアップファイルを作らない
(setq auto-save-default nil)
;;--------------------------------------------------
;;http://www.nanashinonozomi.com/tdiary/20080714.html
(cond
  (window-system
    ;; デフォルトフォントの設定
    ;; フォント名-フォントサイズで指定する。
;;    (set-default-font "VL ゴシック-7")
    (set-default-font "Arial-8")
    ;; 日本語(japanese-jisx0208)フォントの設定
    (set-fontset-font
      (frame-parameter nil 'font)
      'japanese-jisx0208
      '("VL ゴシック" . "unicode-bmp")
;;      '("VL ゴシック:weight=bold" . "unicode-bmp")
      ;; 手元の環境では、↑のようにボールドの設定をしておか
      ;; ないと、いわゆる半角英数文字のボールドフォントが、
      ;; 設定したもの(ここでは VL ゴシック)にならない。
    )
  )
)
;;--------------------------------------------------
(set-cursor-color "yellow")
;;(setq split-window-vertically)
(setq truncate-partial-width-windows nil)
;;Font lock ON キーワードを色付け
(global-font-lock-mode t)
;;他のアプリケーションとのコピペを可能にする
(setq x-select-enable-clipboard t)
;;ツールバーを消す
(tool-bar-mode nil)
;;ChangeLog用ユーザー名とアドレスを設定
(setq user-full-name "Soichi Ishida")
(setq user-mail-address "zau_777_emacs@kki.biglobe.ne.jp")

;; ; 日本語をデフォルトにする。
;; (set-language-environment "Japanese")
;; ; anthy.el をロードできるようにする (必要に応じて)。
;; (push "/usr/local/share/emacs/site-lisp/anthy/" load-path)
;; ; anthy.el をロードする。
;; (load-library "anthy")
;; ; japanese-anthy をデフォルトの input-method にする。
;; (setq default-input-method "japanese-anthy")

;; (add-hook 'anthy-mode-hook
;;    #'(lambda()
;; (set-cursor-color (if anthy-mode '"cyan" '"white"))))

;;----------linum setup:F5でon/offの切り替え可能----------------------
;;http://ccl.scc.kyushu-u.ac.jp/~ebiszk/emacs/lisp.html------------
;;より抜粋----------------------------------------------------------
(require 'linum)
(global-set-key [f5] 'linum-mode)
(add-hook 'lisp-interaction-mode-hook (lambda () (linum-mode t)))
(add-hook 'text-mode-hook (lambda () (linum-mode t)))
;;;====================================
;;;; print - 印刷設定
;;;====================================
;;; Postscript で印刷
(setq my-print-command-format "nkf -e | e2ps -a4 -p | lpr")
(defun my-print-region (begin end)
     (interactive "r")
     (shell-command-on-region begin end my-print-command-format))
(defun my-print-buffer ()
    (interactive)
    (my-print-region (point-min) (point-max)))
;;モードラインの色を変える------------------------------------------------
(set-face-foreground 'modeline "blue")
;;--------------------------------------------------
;;YaTeXモードの設定
(setq auto-mode-alist
      (cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
(autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t)
;;----------BBDBsetup----------------------------------------------
;;http://www.bookshelf.jp/texi/gnus/gnus-ja_10.html#SEC501
;;より
(require 'bbdb)
;; 北アメリカに住んでいるのでなければ、以下によって電話番号の
;; チェックをやめさせるべきです。
(setq bbdb-north-american-phone-numbers-p nil)
;; あなたの電子メールアドレスを BBDB に教えましょう。
(setq bbdb-user-mail-names
      (regexp-opt '("zau_777_emacs@kki.biglobe.ne.jp"
                    "soujiro0725@gmail.com")))
;; メールアドレスを補完するときに、候補をエンドレスで出します。
;; cycling while completing email addresses
(setq bbdb-complete-name-allow-cycling t)
;; BBDB のバッファーをポップアップさせません。
(setq bbdb-use-pop-up nil)
;;-------------------------------------------------------------------
;;w3m for newsticker
(require 'w3m-load)
(setq w3m-use-cookies t)
;;from
;;here
;;http://groups.google.com/group/emacs-g-client/browse_thread/thread/8dd33df945222c1a
(setq g-html-handler 'w3m) ;;required for google service
;;--------------------------------------------------
(setq newsticker-html-renderer 'w3m-region
      browse-url-browser-function 'w3m-browse-url)
(setq w3m-fill-column -3)
;;--------------------------------------------------------------------

;;====================================================================
;;Maxima set-up
;;; add to load-path the directory where imaxima.el is installed.
;;; If you change the install directory of imaxima, the first argument of push must be
;;; changed accordingly.
(push "/usr/local/share/emacs/site-lisp" load-path)
;;; add to load-path the directory where maxima.el is installed.
;;; If you change the install directory of maxima, the first argument of push must be
;;; changed accordingly.
(push "/usr/share/maxima/5.13.0/emacs" load-path)
;;; add autoload of imaxima and maxima.
(autoload 'imaxima "imaxima" "Frontend for maxima with Image support" t)
(autoload 'maxima "maxima" "Frontend for maxima" t)
;;; add autoload of imath.
(autoload 'imath-mode "imath" "Imath mode for math formula input" t)
;;; Make the line effective if you want to use maxima mode with imaxima.
;; (setq imaxima-use-maxima-mode-flag t)
;;=====================================================================
;;-----JAVA環境の設定----------------------------------------------------
;;(autoload 'jde-mode "jde" "Java Development Environment for Emacs." t)
;;(setq auto-mode-alist (cons '("\.java$" . jde-mode) auto-mode-alist))
;;-----メールアドレスを自動で挿入する--------------------------------------
;;(setq user-full-name "Ishida, Soichi")
;;(setq user-mail-address "zau_777_emacs@kki.biglobe.ne.jp")
;======================================================================
; JDEE
;======================================================================
(require 'jde)
(autoload 'jde-mode "jde" "Java Development Environment for Emacs." t)
(setq auto-mode-alist
      (cons '("\.java$" . jde-mode) auto-mode-alist))
(setq user-full-name "Soichi Ishida")
(setq user-mail-address "zau_777_emacs@kki.biglobe.ne.jp")
(add-hook 'jde-mode-hook
          '(lambda ()
             (c-set-offset 'arglist-intro '+)
             (c-set-offset 'arglist-close 0)
         (c-set-offset 'topmost-intro-cont 0)
             (c-set-offset 'func-decl-cont 0)
             (setq indent-tabs-mode nil)
         ))
(let ((elem (assq 'encoded-kbd-mode minor-mode-alist)))
  (when elem
    (setcar (cdr elem) "")))
;;
;;-----cedetの設定------------------------------------------------------
(setq semantic-load-turn-useful-things-on t)
(load "cedet")
;;=====================================================================
;;=======マウスの位置のバッファがアクティブになる===========================
;;http://www.bookshelf.jp/soft/meadow_31.html#SEC439
(require 'follow-mouse)
;;とりあえずオフにしておく
;;オンにするにはコメントを外す
;;(turn-on-follow-mouse)
;;=====================================================================
;;========dismal-mode=================================================
;; (load "/usr/local/share/emacs/dismal-1.4/dismal-mode-defaults.el")
;; ;;--------------------------------------------------------------------
;; ;;====================================================================
(load "~/.twitter.el")
;;==============================================
;;howmの設定
;;http://www.bookshelf.jp/soft/meadow_38.html#SEC560
(setq howm-menu-lang 'ja)
(global-set-key "\C-c,," 'howm-menu)
(mapc
 (lambda (f)
   (autoload f
     "howm" "Hitori Otegaru Wiki Modoki" t))
 '(howm-menu howm-list-all howm-list-recent
             howm-list-grep howm-create
             howm-keyword-to-kill-ring))
;;-----------------------------------------------
;;howm追加設定
;; リンクを TAB で辿る
(eval-after-load "howm-mode"
  '(progn
     (define-key howm-mode-map [tab] 'action-lock-goto-next-link)
     (define-key howm-mode-map [(meta tab)] 'action-lock-goto-previous-link)))
;; 「最近のメモ」一覧時にタイトル表示
(setq howm-list-recent-title t)
;; 全メモ一覧時にタイトル表示
(setq howm-list-all-title t)
;; メニューを 2 時間キャッシュ
(setq howm-menu-expiry-hours 2)

;; howm の時は auto-fill で
(add-hook 'howm-mode-on-hook 'auto-fill-mode)

;; RET でファイルを開く際, 一覧バッファを消す
;; C-u RET なら残る
(setq howm-view-summary-persistent nil)

;; メニューの予定表の表示範囲
;; 10 日前から
(setq howm-menu-schedule-days-before 10)
;; 3 日後まで
(setq howm-menu-schedule-days 3)

;; howm のファイル名
;; 以下のスタイルのうちどれかを選んでください
;; で,不要な行は削除してください
;; 1 メモ 1 ファイル (デフォルト)
(setq howm-file-name-format "%Y/%m/%Y-%m-%d-%H%M%S.howm")
;; 1 日 1 ファイルであれば
(setq howm-file-name-format "%Y/%m/%Y-%m-%d.howm")

(setq howm-view-grep-parse-line
      "^\\(\\([a-zA-Z]:/\\)?[^:]*\\.howm\\):\\([0-9]*\\):\\(.*\\)$")
;; 検索しないファイルの正規表現
(setq
 howm-excluded-file-regexp
 "/\\.#\\|[~#]$\\|\\.bak$\\|/CVS/\\|\\.doc$\\|\\.pdf$\\|\\.ppt$\\|\\.xls$")

;; いちいち消すのも面倒なので
;; 内容が 0 ならファイルごと削除する
(if (not (memq 'delete-file-if-no-contents after-save-hook))
    (setq after-save-hook
          (cons 'delete-file-if-no-contents after-save-hook)))
(defun delete-file-if-no-contents ()
  (when (and
         (buffer-file-name (current-buffer))
         (string-match "\\.howm" (buffer-file-name (current-buffer)))
         (= (point-min) (point-max)))
    (delete-file
     (buffer-file-name (current-buffer)))))

;; http://howm.sourceforge.jp/cgi-bin/hiki/hiki.cgi?SaveAndKillBuffer
;; C-cC-c で保存してバッファをキルする
(defun my-save-and-kill-buffer ()
  (interactive)
  (when (and
         (buffer-file-name)
         (string-match "\\.howm"
                       (buffer-file-name)))
    (save-buffer)
    (kill-buffer nil)))
(eval-after-load "howm"
  '(progn
     (define-key howm-mode-map
       "\C-c\C-c" 'my-save-and-kill-buffer)))
;;----------------------------------------
;;howm自動保存の設定
 ;; メニューを自動更新しない
(setq howm-menu-refresh-after-save nil)
;; 下線を引き直さない
(setq howm-refresh-after-save nil)
;;----------------------------------------
;;========================================
;;windows.elの設定------------------------
;;http://technique.sonots.com/?UNIX%2F%E5%AD%A6%E7%94%9F%E3%83%84%E3%83%BC%E3%83%AB%2Felisp%2Fwindows.el
;; Lisp ライブラリの load path に "~s1138001/lib/emacs/lisp" を追加します。
(setq load-path (cons (expand-file-name "~s1138001/lib/emacs/lisp")
                      load-path))

;; windows.el
(require 'windows)
(win:startup-with-window)
(define-key ctl-x-map "C" 'see-you-again)

;; revive.el
(autoload 'save-current-configuration "revive" "Save status" t)
(autoload 'resume "revive" "Resume Emacs" t)
(autoload 'wipe "revive" "Wipe emacs" t)
;;----------------------------------------
;;========================================
;;--g-clientを使う-------------------------
;;--g-clientディレクトリのみを読み込むパス----
;; (setq load-path (cons "/usr/local/share/emacs/emacslisp/g-client" load-path))
;; (load-library "g")
;; (setq g-user-email "soujiro0725@gmail.com")
;; (setq gcal-user-email "soujiro0725@gmail.com")
;;(setq browse-url-browser-function 'w3m-browse-url)
;;----------------------------------------
;;空の新規バッファを開いたときは常にEmacs-Lipsモードとする
(setq default-major-mode 'lisp-interaction-mode)
;;----------------------------------------
;;auto-complete.el設定
(require 'auto-complete)
(global-auto-complete-mode t)
(require 'auto-complete-acr)
;;----------------------------------------
;;pymacs設定====================
;; Pymacs
(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-exec "pymacs" nil t)
(autoload 'pymacs-load "pymacs" nil t)
(eval-after-load "pymacs"
  '(add-to-list 'pymacs-load-path "~/app/emacs/pymacs-elisp"))
;;--------------------------------------------------

No comments:

Post a Comment