help-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Tassilo Horn
Subject: Re: Unloading modes (php-mode, sgml-mode, etc)
Date: Thu, 21 Jun 2007 08:52:11 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

address@hidden writes:

Hi,

> 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.

Normally emacs loads libraries not before they're needed, e.g. you open
a php file.

So if emacs really loads those libs at startup it seems there're some
explicit requires in your `user-init-file' or in the `site-run-file'
your distribution provides.

To unload a lib use `unload-feature'.

,----[ C-h v user-init-file RET ]
| user-init-file is a variable defined in `C source code'.
| Its value is 
| "/home/heimdall/.emacs"
| 
| 
| Documentation:
| File name, including directory, of user's initialization file.
| If the file loaded had extension `.elc', and the corresponding source file
| exists, this variable contains the name of source file, suitable for use
| by functions like `custom-save-all' which edit the init file.
| While Emacs loads and evaluates the init file, value is the real name
| of the file, regardless of whether or not it has the `.elc' extension.
`----

,----[ C-h v site-run-file RET ]
| site-run-file is a variable defined in `startup.el'.
| Its value is "site-start"
| 
| 
| Documentation:
| File containing site-wide run-time initializations.
| This file is loaded at run-time before `~/.emacs'.  It contains inits
| that need to be in place for the entire site, but which, due to their
| higher incidence of change, don't make sense to load into Emacs's
| dumped image.  Thus, the run-time load order is: 1. file described in
| this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.
| 
| Don't use the `site-start.el' file for things some users may not like.
| Put them in `default.el' instead, so that users can more easily
| override them.  Users can prevent loading `default.el' with the `-q'
| option or by setting `inhibit-default-init' in their own init files,
| but inhibiting `site-start.el' requires `--no-site-file', which
| is less convenient.
| 
| This variable is defined for customization so as to make
| it visible in the relevant context.  However, actually customizing it
| is not allowed, since it would not work anyway.  The only way to set
| this variable usefully is to set it while building and dumping Emacs.
`----

,----[ C-h f unload-feature RET ]
| unload-feature is an interactive compiled Lisp function in `loadhist.el'.
| (unload-feature FEATURE &optional FORCE)
| 
| Unload the library that provided FEATURE, restoring all its autoloads.
| If the feature is required by any other loaded code, and prefix arg FORCE
| is nil, raise an error.
| 
| This function tries to undo modifications made by the package to
| hooks.  Packages may define a hook FEATURE-unload-hook that is called
| instead of the normal heuristics for doing this.  Such a hook should
| undo all the relevant global state changes that may have been made by
| loading the package or executing functions in it.  It has access to
| the package's feature list (before anything is unbound) in the
| variable `unload-hook-features-list' and could remove features from it
| in the event that the package has done something normally-ill-advised,
| such as redefining an Emacs function.
`----

Bye,
Tassilo
-- 
      "DRM manages rights in the same way a jail manages freedom"


reply via email to

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