From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: Unloading modes (php-mode, sgml-mode, etc) Date: Thu, 21 Jun 2007 18:24:34 +1000 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <87abut90l9.fsf@lion.rapttech.com.au> References: <1182402385.915284.55190@o61g2000hsh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1182415273 21359 80.91.229.12 (21 Jun 2007 08:41:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Jun 2007 08:41:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 21 10:41:10 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I1IE2-00063O-I9 for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Jun 2007 10:41:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I1IE2-0004QY-3w for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Jun 2007 04:41:10 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news3.google.com!sn-xt-sjc-04!sn-xt-sjc-07!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:ckAIAT2G+lD4xr4+WHhYPWzMyh4= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 51 Original-Xref: shelby.stanford.edu gnu.emacs.help:149615 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:45200 Archived-At: 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