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: Wed, 07 Nov 2007 17:13:57 -0000
User-agent: G2/1.0

Sebastian Tennant wrote:
> My ~/.emacs reads like this:
>
>  ;;; generate auto-autoloads.el in ~/elisp/dotemacs/
>  (let ((generated-autoload-file "~/elisp/dotemacs/auto-autoloads.el")
>        (backup-inhibited t))
>    (apply 'update-directory-autoloads '("~/elisp/lib/"))
>    (kill-buffer (file-name-nondirectory generated-autoload-file)))
>
>  ;;; load dotemacs/*.el  (including auto-autoloads.el)
>  (mapc (lambda (f) (load f))
>    (split-string
>      (shell-command-to-string "find ~/elisp/dotemacs -name *.el")))
>
> That's it, essentially.
>
> 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.
>
> I can put my customisations and functions in as many .el files as I like
> within their respective directories, making it much easier to organise
> things generally.
>
> And to ensure a library function is always to hand (but not loaded) I
> simply need to remember to include an autoload cookie (;;;###autoload)
> in the library file, and an autoload form will be dynamically
> constructed and called at startup, i.e., there's no longer any need to
> write autoload forms manually any more.
>
> It's a win-win is it not?  It works for me.
>
> Sebastian

Could you please elaborate on how this works a little?
I did try to understand this by following the info/help:
update-directory-autoloads -> update-file-autoloads -> loaddefs.el ->
magic cookies
And by now I am quite lost.
I really would like to have a tiny little .emacs file and a bunch of
files and directories containing unrelated stuff



reply via email to

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