all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* An alternative to a monolithic ~/.emacs init file
@ 2007-10-30 15:04 Sebastian Tennant
  2007-10-30 20:30 ` Sebastian Tennant
  0 siblings, 1 reply; 15+ messages in thread
From: Sebastian Tennant @ 2007-10-30 15:04 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2007-11-14  3:52 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.2759.1193756709.18990.help-gnu-emacs@gnu.org>
2007-11-07 17:13 ` An alternative to a monolithic ~/.emacs init file rustom
2007-11-08 13:08   ` Sebastian Tennant
     [not found]   ` <mailman.3126.1194527313.18990.help-gnu-emacs@gnu.org>
2007-11-08 19:53     ` rustom
2007-11-09 14:18       ` Sebastian Tennant
     [not found]       ` <mailman.3180.1194617919.18990.help-gnu-emacs@gnu.org>
2007-11-10 12:18         ` rustom
2007-11-10 17:13           ` Tom Tromey
     [not found]           ` <mailman.3247.1194750639.18990.help-gnu-emacs@gnu.org>
2007-11-11 15:29             ` rustom
2007-11-12 21:56               ` Tim X
2007-11-13  4:21                 ` rustom
2007-11-13  9:26                   ` Tim X
2007-11-14  3:52                     ` rustom
2007-11-13  1:22             ` rustom
2007-11-11  0:09       ` Francisco Miguel Colaço
2007-10-30 15:04 Sebastian Tennant
2007-10-30 20:30 ` Sebastian Tennant

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.