[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

how to disable jde auto-load in emacs?



On May  4, yuanyuan (minixer@163.com) wrote:
 > HI:
 > 	Those days I installed the jde wiht "atp-get install jde"
 > 
 > 	It alse installed the bsh,ede,eieio,elib,semantic and speedbar-beta. So
 > when I start the emacs, no mater to open what file, it will take 5 or
 > more seconds to load el-files of those package. I want to not auto-load
 > the jde, bsh ede, eieio(etc) when I open files exclude java files and to
 > load jde when I open a java file. How can I do it?
 > 
 > 	Thank you!
 > 
 > 	I found the start el-file for jde,ede(etc) are located
 > in /etc/emacs/site-start.d, but I don't know how to change it.

I don't have jde installed, so the following is untested, but I hope it's
helpful anyway.  I can think of two possible routes:

(1) The autoload function in Emacs has the form

(autoload foo bar)

and is used to tell Emacs "load file bar when function foo is called", so it
avoids loading the whole file until you actually use the function.  This is
typically used when there is a particular function that you call to begin
using some group of related functions; for example, info is loaded this way.

(2) You can take the lines in /etc/emacs/site-start.d and create a function
that executes them, then call that function in a hook.  For example, if the
lines are:

(require 'foo)
(load "bar")

then create a function like this:

(defun my-java-hook ()
  (require 'foo)
  (load "bar"))

and add it to the java mode hook like this:

(add-hook 'java-mode-hook 'my-java-hook)

Then, when you visit a java file, the hook will get executed and load all the
required files.  If you never visit a java file, the files will never get
loaded.

-- 
Neil Roeth



Reply to: