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

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

Re: Speed up Emacs startup


From: Anselm Helbig
Subject: Re: Speed up Emacs startup
Date: Tue, 22 Nov 2005 15:09:42 +0100
User-agent: Wanderlust/2.11.30 (Wonderwall) Emacs/21.4 Mule/5.0 (SAKAKI)

hi sebastien, 

At Tue, 22 Nov 2005 13:56:28 +0100,
Sébastien Vauban <ewgeocaufsfb@spammotel.com> wrote:
> 
> Thank you very much for you precise answer but, if I may
> criticize, I would say your solution has a big drawback
> regarding "readability" of your configuration file: it's then
> not clear at all what's loaded by your `.emacs', and you cannot
> share it on the Web or among colleagues without giving your
> `loaddefs.el' file if you want the others to benefit from the
> same functionalities as the ones you have in your environment.
> 
> That's why a `require' line is still interesting... Do we agree
> on that?

hum, no, i don't think i agree with you. 

environments are different. emacs runs on all different sorts of
platforms, and there are many different, partly compatible emacsen. i
use gnu emacs 21 under debian linux, and have quite some elisp debian
packages installed. i don't have to worry about autoloading for these
at all, it's done with a file in a special startup directory (debian
has modified emacs to use it). 

when you use `require', and the package you are interested in is not
installed, you get an error at startup. is this the best way to inform
you, that you have to install this-or-that-package? i think it's
rather painful: when i move my .emacs to another installation, i
either would have to install quite some packages, or i'd have to
comment out or delete several of these `require's.

before i switched to autoloading, i wanted to make my .emacs portable
between different machines, and i didn't want to install the full set
of packages everywhere. so i changed my `require's to 

        (require 'feature nil t)

meaning: if require fails, don't abort with an error. 

one problem remained: when i wanted to modify lists that were defined in
some package. these lists were not available until the package was
loaded. this is of course no problem if you `require' the package
beforehand. i had to do something like this. 

        (when (require 'feature nil t)
          (setq feature-some-var "some string")
          (add-to-list 'feature-some-list 'some-element))

which with autoloading now looks like this:

        (eval-after-load "feature"
          '(progn
             (setq feature-some-var "some string")
             (add-to-list 'feature-some-list 'some-element)))

that's not much worse. and i can tell which settings belong to which
package. i don't think that's too bad. and inside these blocks i
occasionally `require' some subpackages, which is ok here, too.  

in other words: maybe just having a `require'-line in your .emacs is
not the best way to tell what packages you use. you should keep track
of that explicitly somewhere, maybe in a comment block at the start of
your .emacs, or at the start of a corresponding configuration section.

i only left `require's in my .emacs if the package is either very
small (browse-killring+), binds a lot of keys (vcursor), i really need
it every time (ido, session) or if i was just too lazy to update my
autoloads yet. 

tell me if you know other reasons to keep them. 8-)

i cut my startup time down from 16s to 4s using autoloads. i think it
was worth it. 8-)

kind regards, 

anselm


reply via email to

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