From: formido <formido@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How to Reduce Emacs Load Time
Date: Sun, 31 Aug 2008 10:39:27 -0700 (PDT) [thread overview]
Message-ID: <00aa598d-0849-410a-8424-1dc9db97c5e1@r35g2000prm.googlegroups.com> (raw)
In-Reply-To: mailman.18041.1220182012.18990.help-gnu-emacs@gnu.org
On Aug 31, 4:26 am, Nikolaj Schumacher <m...@nschum.de> wrote:
> p...@informatimago.com (Pascal J. Bourguignon) wrote:
>
> Another tip:
> Use `eval-after-load' a lot. With that you can load minor modes and
> configurations only when a specific major mode has been (auto-)loaded.
>
> I use this to load cedet only when cc-mode is loaded, for example.
Haha! I see others have mentioned cedet, too. That's the package
that's causing me the most pain. See, I just followed .emacs setup
instructions, and I went with the whole kit and kaboodle by using the
load-excessive-helper-functions or whatever. My .emacs looks like:
My .emacs has:
(load "lisp/cedet-1.0pre4/common/cedet.elc")
(semantic-load-enable-excessive-code-helpers)
So, when Emacs starts up, the relevant sections of *messages* looks
like this:
Loading lisp/cedet-1.0pre4/common/cedet.elc...
"/Users/formido/.emacs.d/lisp/cedet-1.0pre4/common/" added to `load-
path'
"/Users/formido/.emacs.d/lisp/cedet-1.0pre4/cogre" added to `load-
path'
"/Users/formido/.emacs.d/lisp/cedet-1.0pre4/ede" added to `load-path'
"/Users/formido/.emacs.d/lisp/cedet-1.0pre4/eieio" added to `load-
path'
"/Users/formido/.emacs.d/lisp/cedet-1.0pre4/semantic" added to `load-
path'
"/Users/formido/.emacs.d/lisp/cedet-1.0pre4/speedbar" added to `load-
path'
"/Users/formido/.emacs.d/lisp/cedet-1.0pre4/contrib" added to `load-
path'
Setting up cedet...done
Setting up cogre...done
Setting up ede...
Loading ede...
Loading ede-speedbar...done
Loading ede...done
Setting up ede...done
Setting up eieio...done
Setting up semantic...done
Setting up speedbar...done
Setting up cedet-contrib...done
Loading lisp/cedet-1.0pre4/common/cedet.elc...done
Loading semantic-idle...done
Loading senator...done
WARNING: Probable vocabulary misuse ahead...
I could set cedet to load when a feature I know about is activated,
like cc-mode, but I'm worried that with all that going on above, all
sorts of features and hooks are being set up that I'll then never find
out about. I would have thought that they'd just set up hooks to
autoload functions as necessary. Is all the above necessary just for
that?
> > - don't load what you need, yet. This means, instead of loading or
> > requiring the packages you may need, define autoloading functions.
> > Good packages will do that for you, when you require them, they load
> > only a file which defines autoloading functions, so you spend time
> > loading the package only when you try to run these functions.
>
> I don't think /good/ packages do that, just /huge/ packages.
> IHMO the proper thing for packages to do is just add ;;;###autoload
> markers, so /you/ can generate the autoloads automatically, if you want
> them (using `update-directory-autoloads').
>
> Package managers like ELPA will do that step automatically when the
> package is updated.
>
> I actually find it annoying if packages have their own autoloading,
> because I need to exclude them specifically. Pretty much every other
> package I can autoload automatically with something like this: (My
> actual code is more complicated, so this is just a prototype...)
>
> (defun update-autoloads ()
> (dolist (file (directory-files package-dir t "[^.]" t))
> (when (file-directory-p file)
> (add-to-list 'loaddef-dirs file)))
> (add-to-list 'loaddef-dirs package-dir)
>
> (let ((generated-autoload-file autoload-file))
> (apply 'update-directory-autoloads loaddef-dirs)))
>
> and then just
> (ignore-errors (load autoload-file))
My elisp-foo is still weak: if I understand right, this function only
works if the packages have been tagged with appropriate metadata,
i.e., autoload markers?
> I only need to define manual autoloads for three packages or so...
> regards,
> Nikolaj Schumacher
Michael
next prev parent reply other threads:[~2008-08-31 17:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-30 21:11 How to Reduce Emacs Load Time formido
2008-08-30 22:00 ` Pascal J. Bourguignon
2008-08-31 11:26 ` Nikolaj Schumacher
[not found] ` <mailman.18041.1220182012.18990.help-gnu-emacs@gnu.org>
2008-08-31 17:39 ` formido [this message]
2008-08-31 22:24 ` Nikolaj Schumacher
2008-08-31 17:50 ` formido
2008-09-08 12:38 ` Eric Ludlam
2008-08-30 22:05 ` Pascal J. Bourguignon
2008-08-30 22:03 ` formido
2008-08-31 11:59 ` Joost Diepenmaat
2008-08-31 9:39 ` Ivan Kanis
2008-08-31 12:35 ` Nikolaj Schumacher
[not found] ` <mailman.18043.1220186144.18990.help-gnu-emacs@gnu.org>
2008-08-31 20:01 ` Chetan
2008-08-31 11:39 ` David
[not found] ` <mailman.18042.1220182790.18990.help-gnu-emacs@gnu.org>
2008-08-31 17:42 ` formido
2008-08-31 19:10 ` David
2008-08-31 22:10 ` Nikolaj Schumacher
2008-08-31 22:20 ` David
[not found] ` <mailman.18077.1220220611.18990.help-gnu-emacs@gnu.org>
2008-08-31 22:36 ` formido
2008-09-02 18:04 ` Ken Goldman
2008-09-03 13:06 ` rustom
2008-09-03 17:06 ` Rupert Swarbrick
2008-09-04 11:01 ` rustom
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=00aa598d-0849-410a-8424-1dc9db97c5e1@r35g2000prm.googlegroups.com \
--to=formido@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/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.
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.