From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rustom Newsgroups: gmane.emacs.help Subject: Re: An alternative to a monolithic ~/.emacs init file Date: Wed, 07 Nov 2007 17:13:57 -0000 Organization: http://groups.google.com Message-ID: <1194455637.485972.177570@s15g2000prm.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: ger.gmane.org 1194457267 15843 80.91.229.12 (7 Nov 2007 17:41:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Nov 2007 17:41:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 07 18:41:10 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ipoth-0004No-U4 for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Nov 2007 18:41:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IpotW-0003yR-Km for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Nov 2007 12:40:50 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!s15g2000prm.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-NNTP-Posting-Host: 59.95.25.253 Original-X-Trace: posting.google.com 1194455638 14675 127.0.0.1 (7 Nov 2007 17:13:58 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 7 Nov 2007 17:13:58 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20070508 Iceweasel/2.0.0.4 (Debian-2.0.0.4-0etch1),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: s15g2000prm.googlegroups.com; posting-host=59.95.25.253; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Original-Xref: shelby.stanford.edu gnu.emacs.help:153604 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49070 Archived-At: 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