* Unloading modes (php-mode, sgml-mode, etc)
@ 2007-06-21 5:06 kevfinn
2007-06-21 6:52 ` Tassilo Horn
2007-06-21 8:24 ` Tim X
0 siblings, 2 replies; 9+ messages in thread
From: kevfinn @ 2007-06-21 5:06 UTC (permalink / raw)
To: help-gnu-emacs
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.
Smokey
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Unloading modes (php-mode, sgml-mode, etc)
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
1 sibling, 0 replies; 9+ messages in thread
From: Tassilo Horn @ 2007-06-21 6:52 UTC (permalink / raw)
To: help-gnu-emacs
kevfinn@gmail.com 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"
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Unloading modes (php-mode, sgml-mode, etc)
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
2007-06-21 15:43 ` XheelhookX
1 sibling, 1 reply; 9+ messages in thread
From: Tim X @ 2007-06-21 8:24 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Unloading modes (php-mode, sgml-mode, etc)
2007-06-21 8:24 ` Tim X
@ 2007-06-21 15:43 ` XheelhookX
2007-06-21 16:56 ` Tassilo Horn
0 siblings, 1 reply; 9+ messages in thread
From: XheelhookX @ 2007-06-21 15:43 UTC (permalink / raw)
To: help-gnu-emacs
Is there a way to do this without having to touch the system libraries
(I don't have root access)? For example every time I emacs a file
with a .html extension I get:
"----:---F1 test.html (HTML)--L1--
All---------------------------------------------------------------------------------------------------------------------
Loading sgml-mode...done"
How can I unload sgml-mode through my .emacs file? Can anyone give me
the exact text to put in the .emacs file to do so? Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Unloading modes (php-mode, sgml-mode, etc)
2007-06-21 15:43 ` XheelhookX
@ 2007-06-21 16:56 ` Tassilo Horn
2007-06-21 17:42 ` XheelhookX
0 siblings, 1 reply; 9+ messages in thread
From: Tassilo Horn @ 2007-06-21 16:56 UTC (permalink / raw)
To: help-gnu-emacs
XheelhookX@gmail.com writes:
> For example every time I emacs a file with a .html extension I get:
>
> "----:---F1 test.html (HTML)--L1--
> All------------------------------------------------------------------
> Loading sgml-mode...done"
>
> How can I unload sgml-mode through my .emacs file?
That's correct behavior. Emacs sees that it's a html file, so it loads
html-mode which is derived from sgml-mode, so it has to load that, too.
Do I get it right that you want emacs to open all files in fundamental
mode and don't want to use any other more specific mode?
Then a solution might be to set `auto-mode-alist' and `magic-mode-alist'
to nil. But I don't see any sense in refusing to use file specific
modes...
Bye,
Tassilo
--
A morning without coffee is like something without something else.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Unloading modes (php-mode, sgml-mode, etc)
2007-06-21 16:56 ` Tassilo Horn
@ 2007-06-21 17:42 ` XheelhookX
2007-06-21 18:27 ` Tassilo Horn
0 siblings, 1 reply; 9+ messages in thread
From: XheelhookX @ 2007-06-21 17:42 UTC (permalink / raw)
To: help-gnu-emacs
On Jun 21, 11:56 am, Tassilo Horn <tass...@member.fsf.org> wrote:
> Xheelho...@gmail.com writes:
> > For example every time I emacs a file with a .html extension I get:
>
> > "----:---F1 test.html (HTML)--L1--
> > All------------------------------------------------------------------
> > Loading sgml-mode...done"
>
> > How can I unload sgml-mode through my .emacs file?
>
> That's correct behavior. Emacs sees that it's a html file, so it loads
> html-mode which is derived from sgml-mode, so it has to load that, too.
>
> Do I get it right that you want emacs to open all files in fundamental
> mode and don't want to use any other more specific mode?
>
> Then a solution might be to set `auto-mode-alist' and `magic-mode-alist'
> to nil. But I don't see any sense in refusing to use file specific
> modes...
>
> Bye,
> Tassilo
> --
> A morning without coffee is like something without something else.
Fantastic. Yes, I didn't want to load any modes, just fundamental. I
added these to my .emacs:
(setq auto-mode-alist nil)
(setq magic-mode-alist nil)
and it seems to be working. Thanks a ton, this has been killing me
for ages.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Unloading modes (php-mode, sgml-mode, etc)
2007-06-21 17:42 ` XheelhookX
@ 2007-06-21 18:27 ` Tassilo Horn
0 siblings, 0 replies; 9+ messages in thread
From: Tassilo Horn @ 2007-06-21 18:27 UTC (permalink / raw)
To: help-gnu-emacs
XheelhookX@gmail.com writes:
Hi,
> Fantastic. Yes, I didn't want to load any modes, just fundamental. I
> added these to my .emacs:
>
> (setq auto-mode-alist nil)
> (setq magic-mode-alist nil)
>
> and it seems to be working. Thanks a ton, this has been killing me
> for ages.
Now I'm curious. Why do you use emacs but don't use specialized modes?
If it's only because of the keybinding and you want a very quick editor,
then maybe jed [1] or mg [2] fit more your likings.
Bye,
Tassilo
__________
[1] http://www.jedsoft.org/jed/
[2] http://www.xs4all.nl/~hanb/software/mg/
--
Using his trademark roundhouse kick, Chuck Norris once made a fieldgoal
in RJ Stadium in Tampa Bay from the 50 yard line of Qualcomm stadium in
San Diego.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Unloading modes (php-mode, sgml-mode, etc)
@ 2007-06-21 5:43 HeelHook
0 siblings, 0 replies; 9+ messages in thread
From: HeelHook @ 2007-06-21 5:43 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1.1: Type: text/plain, Size: 230 bytes --]
I simply cannot find in the documentation how to unload those pesky mode
libraries that emacs 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.
Pete
[-- Attachment #1.2: Type: text/html, Size: 752 bytes --]
[-- Attachment #2: Type: text/plain, Size: 152 bytes --]
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <mailman.2510.1182497425.32220.help-gnu-emacs@gnu.org>]
* Re: Unloading modes (php-mode, sgml-mode, etc)
[not found] <mailman.2510.1182497425.32220.help-gnu-emacs@gnu.org>
@ 2007-06-23 3:00 ` Barry Margolin
0 siblings, 0 replies; 9+ messages in thread
From: Barry Margolin @ 2007-06-23 3:00 UTC (permalink / raw)
To: help-gnu-emacs
In article <mailman.2510.1182497425.32220.help-gnu-emacs@gnu.org>,
HeelHook <xheelhookx@gmail.com> wrote:
> I simply cannot find in the documentation how to unload those pesky mode
> libraries that emacs 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.
There's no built-in way to do this. You could list all the functions
and variables in the mode and then call unintern on all of them.
Why do you need to do this? What problem does a mode you're not using
cause? Emacs only loads most of those modes if you actually load a
buffer that needs them.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-06-23 3:00 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.