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: Stefan Monnier
Subject: Re: Speed up Emacs startup
Date: Thu, 24 Nov 2005 23:26:06 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> Why not just using locate-library to require the package only if it's
> installed and locatable? There are plenty of sentences like this in my
> .emacs:

> (when (locate-library "muttrc")
>   (require 'muttrc))

The try-require does the same, just more efficiently: when the library is
absent, locate-library and try-require both just go through all the dirs in
load-path and then give up (i.e. no difference).  But if the lib is present,
then in your case locate-library will go through load-path once and require
will go through it again a second time (and it may still signal an error so
you still want to protect yourself against failure).


        Stefan


reply via email to

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