views:

437

answers:

2

My work computer (Ubuntu 8.10) has CEDET version 1.0pre4 installed, and I'm trying to install the newest version of CEDET (1.0pre6) in my local directory (the ultimate goal, upgrading ECB to the newest version).

Unfortunately, the default debian/ubuntu installation initializes the system-wide packages for CEDET and ECB before my .emacs file is called, and the 1.0pre6 files I then try to load throw errors trying to use symbols not defined in 1.0pre4. (See this mailing list thread about someone else reporting the same problem.)

I first tried manually reloading the packages CEDET provides in my .emacs, but one of them can't be reloaded twice.

I am now trying the unload-feature command. When I attempt to unload CEDET, I get the error:

 Lisp error: (error "Loaded libraries (\"/etc/emacs/site-start.d/55ecb.el\") depend on /usr/share/emacs22/site-lisp/cedet-common/cedet.elc")

But there is no ecb feature to unload. There is an ecb-autoloads feature, which appears to be provided by /etc/emacs/site-start.d/55ecb.el, but the library seems to depend on it as well.

I figure I can either somehow get Emacs to unload the system-wide ECB, or I can somehow add most of the content from the system-wide configuration into the top of my .emacs file, dropping the ECB and CEDET loading.

The latter sounds messy, ugly, and unstable. I'd much rather do the former, if I knew how. Or perhaps someone has a better solution to this problem?

A: 

Not knowing how your Emacs is installed, it's difficult to pin down a solution. The first thing I'd try is to disable loading of the site file

emacs --no-site-file

to see if it is loaded from there. It might also be loaded in the library default, but since it is loaded before your .emacs, and default is loaded afterwards, that probably isn't the culprit.

If your admins dumped Emacs with CEDET already loaded, you're out of luck, and will certainly have to roll your own.

That being said, downloading, building and installing Emacs is just as easy as any other bit of software. If I recall, these were the steps: gtar xfz emacs-23.1.tar.gz; cd emacs-23.1; ./configure; gmake; gmake install.


In response to the comment (that you want to still load the rest of site-start), I'd try the following:

  1. Talk to whomever administers your system to get them to fix site-start (the library name is stored in the variable site-run-file) to not load that stuff but instead to put that kind of stuff in default (which is loaded after the user's .emacs)
  2. While waiting for #1 to resolve (if it ever does), invoke Emacs like so

    emacs -q --no-site-file -l hack.el

where hack.el contains something like

;;; some changes to load-path to put your stuff in front of the load-path`
(if site-run-file
    (load site-run-file t t))
;;; now load your .emacs

To find the site-run-file, use M-x find-library and the name stored in site-run-file.

If your admins are vi users and know nothing about Emacs (like mine were at my former job), you can either educate them and hope for the best, or punt and start rolling your own.

Trey Jackson
I already tried that before posting. That stops the loading of the system-wide ECB and CEDET packages, but it also disables loading of all the other system-wide emacs packages, which means I'd need to manually add them, and any other packages added in the future, to my .emacs file. I'd prefer to find a way to just override the emacs load-path before it loads any packages.Looking at the options, I should theoretically be able to use --no-site-file, define my load-path, then call site-start.el. But in Ubuntu/Debian that file is empty, so I don't know where or how it gets called.
AFoglia
A: 

This is probably so obvious that you've tried it already but can't you just have your admins uninstall the CEDET packages on your system?

Noufal Ibrahim
Yes, that's obvious, but I figured there should be a way around it. But we've since upgraded the computers and the sysadmin forgot to reinstall cedet, so I didn't remind him. (I was the only one using it anyway.)
AFoglia