PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/rtlib/emacs/support-jde.el

https://code.google.com/p/lino/
Lisp | 134 lines | 53 code | 49 blank | 32 comment | 2 complexity | e881895fe94ab1d4e2ded9306dc7df3c MD5 | raw file
  1
  2  (add-to-list 'load-path (expand-file-name "t:/soft/emacs/site-lisp/jde/lisp"))
  3  (add-to-list 'load-path (expand-file-name "t:/soft/emacs/site-lisp/semantic"))
  4  (add-to-list 'load-path (expand-file-name "t:/soft/emacs/site-lisp/speedbar"))
  5  (add-to-list 'load-path (expand-file-name "t:/soft/emacs/site-lisp/elib"))
  6  (add-to-list 'load-path (expand-file-name "t:/soft/emacs/site-lisp/eieio"))
  7
  8
  9;; If you want Emacs to defer loading the JDE until you open a 
 10;; Java file, edit the following line
 11;;(setq defer-loading-jde nil)
 12;; to read:
 13;;
 14(setq defer-loading-jde t)
 15;;
 16
 17(if defer-loading-jde
 18    (progn
 19      (autoload 'jde-mode "jde" "JDE mode." t)
 20      (setq auto-mode-alist
 21	    (append
 22	     '(("\\.java\\'" . jde-mode))
 23	     auto-mode-alist)))
 24  (require 'jde))
 25
 26
 27;; Sets the basic indentation for Java source files
 28;; to two spaces.
 29(defun my-jde-mode-hook ()
 30  (setq c-basic-offset 2))
 31
 32(add-hook 'jde-mode-hook 'my-jde-mode-hook)
 33
 34
 35
 36
 37
 38;;Problem I can't get the JDE to use Internet Explorer to display the
 39;;JDK doc or the JDE User's Guide.
 40
 41;;Solution The JDE uses Emacs browse-url interface to web
 42;;browsers. browse-url supports Netscape by default. To use Internet
 43;;Explorer:
 44;; 1. Add the following code to your .emacs file
 45
 46(if (eq system-type 'windows-nt)
 47  (defadvice browse-url-generic (around show-window act)
 48    "*Sets `start-process-show-window' on."
 49    (let ((w32-start-process-show-window t))
 50      ad-do-it)))
 51  
 52
 53;;This code causes Emacs to show the window of the browser launched by
 54;;the function browse-url-generic.
 55
 56
 57
 58
 59
 60
 61
 62
 63;;From: Richard den Adel 
 64;;Subject: Small extension to jde-run to run JUnit tests 
 65;;Date: Tue, 20 Feb 2001 23:01:26 -0800 
 66
 67;;Hi all,
 68
 69;;I have written some lisp functions that allow me to run the JUnit
 70;;test that corresponds with the current buffer.  If your current
 71;;buffer is :com/acriter/util/GUIAccess.java, the jde-run-test-class
 72;;will run the class com.acriter.util.TestGUIAccess and
 73;;jde-run-package-test-class will run the class com.acriter.util.Test
 74;;(we use this syntax to run all tests in a current package, it is an
 75;;automatically generated TestSuite of JUnit.)
 76
 77;;I don't know if it is of any use to anyone but me, but anyway
 78
 79;;It is my first tryout in lisp, so please be gentle to me ;-)
 80
 81
 82(defun jde-run-test-class()
 83  "Runs the corresponding test class that belongs to the current buffer"
 84  (interactive)
 85  (jde-run-internal (jde-run-get-test-class)))
 86
 87
 88(defun jde-run-get-test-class()
 89  "Gets the test class for the current buffer"
 90  (let ((test-class (jde-run-get-main-class)))
 91    (if (string-match ".*Test.*" (jde-run-get-main-class))
 92        (setq test-class (jde-run-get-main-class))
 93      (setq test-class
 94            (concat (jde-db-get-package)
 95                    "Test"
 96                    (file-name-sans-extension
 97                     (file-name-nondirectory (buffer-file-name))))))
 98    test-class))
 99
100(defun jde-run-package-test-class()
101  "Runs the corresponding test class that belongs to the package of the current
102buffer"
103  (interactive)
104  (jde-run-internal (jde-run-get-package-test-class)))
105
106(defun jde-run-get-package-test-class()
107  "Gets the package test class for the current buffer"
108  (let ((package-test-class (concat (jde-db-get-package) "Test")))
109    package-test-class))
110                       
111
112
113
114
115
116
117
118
119
120
121
122
123
124;; Include the following only if you want to run
125;; bash as your shell.
126
127;; Setup Emacs to run bash as its primary shell.
128(setq shell-file-name "bash")
129(setq shell-command-switch "-c")
130(setq explicit-shell-file-name shell-file-name)
131(setenv "SHELL" shell-file-name)
132(setq explicit-sh-args '("-login" "-i"))
133(if (boundp 'w32-quote-process-args)
134  (setq w32-quote-process-args ?\")) ;; Include only for MS Windows.