[Top][All Lists]

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

Re: Unloading modes (php-mode, sgml-mode, etc)

From: Tim X
Subject: Re: Unloading modes (php-mode, sgml-mode, etc)
Date: Thu, 21 Jun 2007 18:24:34 +1000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

address@hidden writes:

> I simply cannot find in the documentation how to unload those pesky
> mode libraries that the default emacs install seems to like to load on
> me: php-mode, sgml-mode, etc. Any ideas on what to put in my .emacs
> file to unload those things? Thanks.

What do you mean exactly by loading the libraries? I ask as emacs generally
only loads libraries when they are required. for example, opening a file called
*.php will load the php mode library, but it will not be loaded before then
unless you (or the site admin) as specifically 'required' those libraries in
one of the init files read by emacs at startup. 

However, if your referring to the stuff loaded on many systems at startup from
directories like /etc/emacs/site-start.d/blah where blah might be something
like 50php-mode.el, then this is a different matter. In this case, those files
are usually not loading the mode/library, but rather setting up things like
autoloads or startup hooks that will affect the library once they are loaded.
to remove these, you can just remove the file (of course, this could then break
the mode when you do want to run it because needed config/setup work won't have
been done). These files typically don't consume much in the way of resources
and probably aren't worth the effort of removing. 

When a mode is automatically loaded after opening a file with either a specific
name/extension, it is normally due to an entry in auto-load-alist. In this
case, you just need to remove that entry. 

If the issue is that you are finding emacs slow to start and want to remove
some of the startup overhead, there are a couple of things you can do -

1. Try compiling files that are loaded at startup. This can speed things up,
but it can cause frustration if you make changes to the source file and don't

2. Create your own set of init files and use the -q switch to prevent loading
the site specific init files. I don't recommend this, but it is one way of
having total control over what is loaded at startup. I don't recommend it as yo
are likely to find things break when changes are made by the admins or when new
versions are installed, plus it can be a pain to create and maintain such
startup files.

The real secret with emacs is to leave it running. I typically have my emacs at
work run all week and the one I have at home runs for weeks (sometimes months)
between restarts. 


tcross (at) rapttech dot com dot au

reply via email to

[Prev in Thread] Current Thread [Next in Thread]