unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: Unloading modes (php-mode, sgml-mode, etc)
Date: Thu, 21 Jun 2007 18:24:34 +1000	[thread overview]
Message-ID: <87abut90l9.fsf@lion.rapttech.com.au> (raw)
In-Reply-To: 1182402385.915284.55190@o61g2000hsh.googlegroups.com

kevfinn@gmail.com 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
recompile. 

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. 

Tim

-- 
tcross (at) rapttech dot com dot au

  parent reply	other threads:[~2007-06-21  8:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-21  5:06 Unloading modes (php-mode, sgml-mode, etc) kevfinn
2007-06-21  6:52 ` Tassilo Horn
2007-06-21  8:24 ` Tim X [this message]
2007-06-21 15:43   ` XheelhookX
2007-06-21 16:56     ` Tassilo Horn
2007-06-21 17:42       ` XheelhookX
2007-06-21 18:27         ` Tassilo Horn
  -- strict thread matches above, loose matches on Subject: below --
2007-06-21  5:43 HeelHook
     [not found] <mailman.2510.1182497425.32220.help-gnu-emacs@gnu.org>
2007-06-23  3:00 ` Barry Margolin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87abut90l9.fsf@lion.rapttech.com.au \
    --to=timx@nospam.dev.null \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).