- 论坛徽章:
- 0
|
;; This .emacs file illustrates the minimul setup
;; required to run the JDE.
;; Set the debug option to enable a backtrace when a
;; problem occurs.
(setq debug-on-error t)
(setq load-path (cons "~/emacs-22.2/lisp" load-path))
;; Update the Emacs load-path to include the path to
;; the JDE and its require packages. This code assumes
;; that you have installed the packages in the emacs/site
;; subdirectory of your home directory.
(add-to-list 'load-path (expand-file-name "~/emacs-22.2/site-lisp/elib"))
(add-to-list 'load-path (expand-file-name "~/emacs-22.2/site-lisp/eieio"))
(add-to-list 'load-path (expand-file-name "~/emacs-22.2/site-lisp/jde/lisp"))
;; Initialize CEDET.
(load-file (expand-file-name "~/emacs-22.2/site-lisp/cedet/common/cedet.el"))
(add-to-list 'load-path (expand-file-name "~/emacs-22.2/site-lisp/semantic"))
(add-to-list 'load-path (expand-file-name "~/emacs-22.2/site-lisp/speedbar"))
; for c code integration
(require 'semantic-c)
; for lisp integration
(require 'semantic-el)
; for makefile
(require 'semantic-make)
; if you use imenu or wich-function
(require 'semantic-imenu)
; for speedbar
(autoload 'semantic-bnf-mode "semantic-bnf" "Mode for Bovine Normal Form." t)
; for editing .bnf file
(add-to-list 'auto-mode-alist '("\.bnf$" . semantic-bnf-mode))
; for semantic-minor-mode
(autoload 'semantic-minor-mode "semantic-mode" "Mode managing semantic parsing." t)
(autoload 'speedbar-frame-mode "speedbar" "popup a speedbar frame" t)
(autoload 'speedbar-get-focus "speedbar" "jump to speedbar frame" t)
;; If you want Emacs to defer loading the JDE until you open a
;; Java file, edit the following line
(setq defer-loading-jde nil)
;; to read:
;;
;; (setq defer-loading-jde t)
;;
(if defer-loading-jde
(progn
(autoload 'jde-mode "jde" "JDE mode." t)
(setq auto-mode-alist
(append
'(("
[url=file://\\.java\\']\\.java\\'[/url]
" . jde-mode))
auto-mode-alist)))
(require 'jde))
;; Sets the basic indentation for Java source files
;; to two spaces.
(defun my-jde-mode-hook ()
(setq c-basic-offset 2))
(add-hook 'jde-mode-hook 'my-jde-mode-hook)
;; Include the following only if you want to run
;; bash as your shell.
;; Setup Emacs to run bash as its primary shell.
(setq shell-file-name "bash")
(setq shell-command-switch "-c")
(setq explicit-shell-file-name shell-file-name)
(setenv "SHELL" shell-file-name)
(setq explicit-sh-args '("-login" "-i"))
(if (boundp 'w32-quote-process-args)
(setq w32-quote-process-args ?\")) ;; Include only for MS Windows.
(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.
'(jde-jdk-registry (quote (("1.5" . "c:/program files/jdk")))))
(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.
)
(setq dframe-xemacsp nil)
(add-hook 'speedbar-load-hook (lambda () (require 'semantic-sb)))
(global-set-key (kbd " b") 'speedbar)
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/46000/showart_687707.html |
|