まとめと .emcas

emacsc++をするための情報をまとめたリンクまとめおよびその他の周辺情報のリンクemacs C++ 開発環境link集をまとめた開発環境は以下で作れる.なおここで紹介している方法の大部分はemacs22でしか動かないので注意.
 まず必要なソフトをインストールする.ubuntu7.10の場合は以下でinstallできる
$sudo apt-get install global exuberant-ctags ecb emacs22
.emacsは以下のようにする(設定済みmeadowでも動くようにしてある.).

;;c-mode auto indent http://at-aka.blogspot.com/2006/12/emacs-c.html
(add-hook 'c-mode-common-hook
          '(lambda ()
             ;; センテンスの終了である ';' を入力したら、自動改行+インデント
             (c-toggle-auto-hungry-state 1)
             ;; RET キーで自動改行+インデント
             (define-key c-mode-base-map "\C-m" 'newline-and-indent)
))

;;c-mode flyspell http://at-aka.blogspot.com/2006/12/emacs-c.html
(add-hook 'c-mode-common-hook
          '(lambda ()
             ;; flyspell-prog-mode をオンにする
             (flyspell-prog-mode)
))

;; C-c c で compile コマンドを呼び出す http://at-aka.blogspot.com/2006/12/emacs-c.html
(define-key mode-specific-map "c" 'compile)

;http://www.bloomington.in.us/~brutt/emacs-c-dev.html
;(c-toggle-hungry-state 1);emacs22 ubuntu7.10で動かない 

;;ffap http://www.bookshelf.jp/soft/meadow_23.html#SEC226
(ffap-bindings)
;(setq ffap-c-path   (cons "~/src"  ffap-c-path   )) ;自分のソース置き場のパスを通す

;;gtags href="http://d.hatena.ne.jp/higepon/20060107/1136628498
(autoload 'gtags-mode "gtags" "" t)

;なぜか動かない。デフォルトのままで使っている
;(setq gtags-mode-hook
;      '(lambda ()
;         (local-set-key "\M-t" 'gtags-find-tag)
;         (local-set-key "\M-r" 'gtags-find-rtag)
;         (local-set-key "\M-s" 'gtags-find-symbol)
;         (local-set-key "\C-t" 'gtags-pop-stack)
;         ))


(add-hook 'c-mode-common-hook
          '(lambda()
             (gtags-mode 1)
             (gtags-make-complete-list)
             ))

(when (and (featurep 'meadow) (locate-library "cygwin-mount"))
  (require 'cygwin-mount)
  (cygwin-mount-activate))


;;gdb href="http://narupon.tdiary.net/20061022.html
(setq gdb-many-windows t)
(setq gdb-use-separate-io-buffer t) ; "IO buffer" が必要ない場合は  nil で


;ecb cedet etc http://d.hatena.ne.jp/Tetsujin/20070720/1184861022
;; Load CEDET
;
;(load-file "~/usr/share/emacs/site-lisp/cedet-1.0pre4/common/cedet.el")
(if (featurep 'meadow)
    (load-file "C:/meadow/packages/lisp/cedet/common/cedet.el")
   (load-file "/usr/share/emacs/site-lisp/cedet-common/cedet.el") ; for ubuntu7.10
)

;; Enabling various SEMANTIC minor modes.  See semantic/INSTALL for more ideas.
;; Select one of the following:
(setq semantic-load-turn-everything-on t)

;;;ecb
;      (add-to-list 'load-path
;                   "~/usr/share/emacs/site-lisp/ecb-2.32")
;      (add-to-list 'load-path
;                   "~/usr/share/emacs/22.1/site-lisp/ecb-2.32")
(if (featurep 'meadow)()
  (require 'ecb)
)

;;flymake with CEDET http://www.emacswiki.org/cgi-bin/wiki/FlyMake から
(if (featurep 'meadow)
    (progn 
      (require 'lmcompile)
      (add-hook 'compilation-finish-functions 'vj-compilation-finish-highlight)
      (defun vj-compilation-finish-highlight (buffer result-str)
        (interactive)
        (lmcompile-do-highlight))
      )
)