unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Anselm Helbig <anselm@chemie.fu-berlin.de>
Subject: Re: Speed up Emacs startup
Date: Tue, 22 Nov 2005 15:09:42 +0100	[thread overview]
Message-ID: <87psosrcyh.wl@nospam.anselm.chemie.fu-berlin.de> (raw)
In-Reply-To: <uzmnwu9hf.fsf@missioncriticalit.com>

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	other threads:[~2005-11-22 14:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.14537.1131532545.20277.help-gnu-emacs@gnu.org>
2005-11-09 17:05 ` List of major modes? rgb
2005-11-22  8:39   ` Speed up Emacs startup Sébastien Vauban
2005-11-22 11:19     ` Anselm Helbig
2005-11-22 12:56       ` Sébastien Vauban
2005-11-22 14:09         ` Anselm Helbig [this message]
2005-11-22 16:39           ` Sébastien Vauban
2005-11-23  0:07             ` Anselm Helbig
2005-11-23  8:59             ` Ismael Valladolid Torres
     [not found]             ` <mailman.16441.1132736439.20277.help-gnu-emacs@gnu.org>
2005-11-24 10:03               ` Jason Rumney
2005-11-25  4:26               ` Stefan Monnier
2005-11-22 14:18     ` Lennart Borgman
2005-11-22 20:11     ` Stefan Monnier

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=87psosrcyh.wl@nospam.anselm.chemie.fu-berlin.de \
    --to=anselm@chemie.fu-berlin.de \
    /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).