2

I'm on Ubuntu 14.04, with: GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian and have discovered something disturbing/annoying.

I have been trying to use the latest version of CEDET via el-get but kept getting the error of Emacs' built-in CEDET has already been loaded! Restart Emacs to load CEDET from el-get instead. This was strange since it happened even after I commented everything in my .emacs out except for el-get code. Upon starting up with --debug-init, I saw that code is being running from /etc/emacs/site-start.d/. This is before my .emacs even gets a chance to respond. I'm guessing that something in there is doing a (require 'cedet), or at least a provide.

What can I do in this situation? Do I need to recompile emacs? Or skip the apt-get version all together and build from source? And how is it possible that the emacs binary is loading code before the .emacs? Is there some kind of meta .emacs? Or was this some kind of build flag during compilation?

EDIT: I got some info from apt-cache show emacs24-el

EDIT2: Got more relevant info from https://www.debian.org/doc/packaging-manuals/debian-emacs-policy

3 Answers 3

3

See the manual: C-hig (emacs) Init File RET

Use emacs --no-site-file to inhibit the site-start.el file, which is loaded before your init file, and which Debian is presumably using to load code from /etc/emacs/site-start.d/

Try M-x find-library RET site-start RET

If that's not the one, then Debian may (more nicely) be using default.el which you can override in your init file, rather than needing a command-line argument:

(setq inhibit-default-init t)

Similarly, to check for that library: M-x find-library RET default RET

Everything you've said points to site-start.el however.

Of course, if you're the only user, you could likely just delete everything you don't want from site-start.d. Updating the Debian package may or may not put them back again.

If you fancy taking the bull by the horns, you could start compiling Emacs for yourself, and do away with the Debian packages entirely.

3
  • 1
    Thanks! I went ahead and just compiled from source, wasn't that bad at all and everything works. Even have a benefit of a faster startup since it isn't loading up all that debian crap.
    – c-o-d
    Oct 9, 2014 at 4:52
  • This is using a bulldozer to swat a fly. Starting Emacs with --no-site-file will cause a lot of useful stuff to become invisible. Modifying default.el is only possible if you're root (and if you're root, there's a better way). Recompiling Emacs has a huge overhead. Oct 9, 2014 at 22:46
  • Gilles: Was that directed at me? Making the site-start "useful stuff" invisible was the stated requirement of the question, and modifying default.el isn't necessary at all if all you want to do is disable it. Compiling Emacs certainly has a sizeable overhead, but I doubt that would come as a surprise to anyone considering it as an option.
    – phils
    Oct 10, 2014 at 5:41
1

Before loading your locally installed package in your ~.emacs~, make sure to unload the site-wide installed package. The emacs-lisp function unload-feature is your friend. I do not which features provides CEDET in particular. For a system-wide installed auctex, however, you would do (unload-feature 'tex-site), for example.

0

From the Debian policy document that you link to:

/etc/emacs/site-start.el is a conffile, and is owned by emacsen-common. This file should not be modified by any add-on packages, or by any emacsen package maintainer. It is solely for the use of the local admin. It should be empty unless the local admin modifies it.

That means, there shouldn't be anything in /etc/emacs/site-start.el unless you (or whomever administers your computer) explicitly put it there. If that's not the case, this is a bug that should be reported to the Ubuntu or Debian maintainers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.