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

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

Re: An alternative to a monolithic ~/.emacs init file


From: rustom
Subject: Re: An alternative to a monolithic ~/.emacs init file
Date: Sat, 10 Nov 2007 12:18:19 -0000
User-agent: G2/1.0

Thanks Sebastian for a detailed response. But I cant see how it will
work. Let me try and collect the pieces of the jigsaw as I understand
them.
Firstly the organization

On Nov 9, 7:18 pm, Sebastian Tennant <seb...@smolny.plus.com> wrote:

> With this arrangement, library functions I've written that I don't always 
> want to load at startup, but I do want to have
> to hand, go in ~/elisp/lib, and customisations (and functions I do always 
> want to load at startup) go in
> ~/elisp/dotemacs.

Second the scales:
Lets assume that elisp/lib contains thousands of lines of lisp
distilled into say about 10 autoloads and a few customizations. In
general the user is never expected to use the 10 autoloads together.

Now the call:  (apply 'update-directory-autoloads '("~/elisp/lib"))
or   (update-directory-autoloads "~/elisp/lib")
will traverse the whole lib file-set -- all the thousands of lines --
at startup losing the advantage of autoloading.

For using an elisp module let us say foo I guess we need the following
three phases:

Phase 1 (To be run only when foo is added to elisp/lib)  Run update-
file-autloads and generate the autoloads into loaddefs.el in elisp/lib/
foo

Phase 2. Add a set of user customizations (called say
customizations.el) to elisp/lib/foo [Also one-time like the above]

Phase 3. In .emacs -- run on emacs startup -- Have a function say load-
loaddefs-from-directory that goes through each subdirectory in lib,
finds all files called loaddefs.el and loads them.

This way the .emacs can be nothing more than the two lines

(load-loaddefs-from-directory "~/elisp/lib")
(load-customizations-from-directory "~/elisp/lib")

And there are no superfluous file traversals at emacs startup time

Knowing emacs and its community I guess this functionality is already
available!

Question is what is it called :-)



reply via email to

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