From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anselm Helbig Newsgroups: gmane.emacs.help Subject: Re: Speed up Emacs startup Date: Tue, 22 Nov 2005 12:19:24 +0100 Organization: Freie Universitaet Berlin Message-ID: <87oe4dszer.wl@nospam.anselm.chemie.fu-berlin.de> References: <1131555901.719511.200390@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1132661578 14751 80.91.229.2 (22 Nov 2005 12:12:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 22 Nov 2005 12:12:58 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 22 13:12:49 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EeWyz-0002lO-03 for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Nov 2005 13:10:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EeWyx-0007lS-TZ for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Nov 2005 07:10:43 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 40 Original-X-Trace: news.uni-berlin.de lqTPCcT7OnFVeASdP0IYnAoGhtkOZ3uwm3htbJZWg85F5sMYx0U0B/x7Ug X-Orig-Path: azrael.lygophilia.de!news In-Reply-To: Mail-Followup-To: anselm@chemie.fu-berlin.de User-Agent: Wanderlust/2.11.30 (Wonderwall) Emacs/21.4 Mule/5.0 (SAKAKI) Microsoft: Programs so large they have weather. Original-Xref: shelby.stanford.edu gnu.emacs.help:135641 Original-To: help-gnu-emacs@gnu.org 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:31244 Archived-At: > Just a quick question which does not seem so obvious to be > answered: is there an easy way to speed up Emacs launch without > sacrificing the readability and shortness of the .emacs file? > > I mean: I don't like the autoload statements where you need tens > of lines instead of one require function call. Is it possible to > write a modified "require" that would provide the same kind of > effect (ie, load files only when they are truly needed OR when > the system is idle)? you can generate the autoloads automatically and put them in your private loaddefs.el. elisp files have `magic comments' in their code for this. unfortunately, there only is a mechanism to generate autoloads for the emacs source tree (speaking of gnu emacs 21 here, somebody correct/update me if i'm wrong), but you can adapt it for your private elisp dir. it did something like this (untested, my real solution was uglier): (let ((source-directory my-lisp-dir)) (update-autoloads-from-directories my-lisp-dir)) this way you fool update-autoloads-from-directories to think your private lisp directory is the emacs source tree, and then have it generate autoloads for that. a loaddefs.el is generated in your lisp dir, in the subdirectory `lisp', which you should have created before. (if you don't set/shadow `source-directory' then you probably won't be able to write loaddefs.el, or your emacs' loaddefs.el will be overwritten.) the only line you have to add to your .emacs is something like (load (concat my-lisp-dir) "lisp/loaddefs.el") i hope this solution is elegant enough for you. 8-) regards, anselm