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: Sat, 10 Nov 2007 12:18:19 -0000 Organization: http://groups.google.com Message-ID: <1194697099.703581.205890@i38g2000prf.googlegroups.com> References: <1194455637.485972.177570@s15g2000prm.googlegroups.com> <1194544126.425679.261670@e9g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: ger.gmane.org 1194698447 29869 80.91.229.12 (10 Nov 2007 12:40:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Nov 2007 12:40:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 10 13:40:51 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 1Iqpdo-0002Tn-DS for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2007 13:40:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iqpdc-0001Ic-LP for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2007 07:40:36 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!i38g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 47 Original-NNTP-Posting-Host: 59.95.35.46 Original-X-Trace: posting.google.com 1194697103 7219 127.0.0.1 (10 Nov 2007 12:18:23 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 10 Nov 2007 12:18:23 +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: i38g2000prf.googlegroups.com; posting-host=59.95.35.46; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Original-Xref: shelby.stanford.edu gnu.emacs.help:153663 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:49123 Archived-At: 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 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 :-)