From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.help Subject: Re: How to Reduce Emacs Load Time Date: Sun, 31 Aug 2008 13:26:45 +0200 Message-ID: References: <18aba2b0-4fc7-4588-b69f-d9f46b264b03@q26g2000prq.googlegroups.com> <87r686rwmj.fsf@hubble.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1220182038 20938 80.91.229.12 (31 Aug 2008 11:27:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Aug 2008 11:27:18 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: pjb@informatimago.com (Pascal J. Bourguignon) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 31 13:28:12 2008 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 1KZl6J-0004Is-L6 for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Aug 2008 13:28:11 +0200 Original-Received: from localhost ([127.0.0.1]:42035 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZl5K-0004Te-Ni for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Aug 2008 07:27:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KZl51-0004TZ-Ma for help-gnu-emacs@gnu.org; Sun, 31 Aug 2008 07:26:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KZl4z-0004SU-7v for help-gnu-emacs@gnu.org; Sun, 31 Aug 2008 07:26:50 -0400 Original-Received: from [199.232.76.173] (port=44834 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZl4z-0004SR-2y for help-gnu-emacs@gnu.org; Sun, 31 Aug 2008 07:26:49 -0400 Original-Received: from dd18200.kasserver.com ([85.13.138.168]:32998) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KZl4y-00024l-Oc for help-gnu-emacs@gnu.org; Sun, 31 Aug 2008 07:26:49 -0400 Original-Received: from arwen.uni-trier.de (kobz-590f11bc.pool.einsundeins.de [89.15.17.188]) by dd18200.kasserver.com (Postfix) with ESMTP id 4373F1802CDB0; Sun, 31 Aug 2008 13:26:49 +0200 (CEST) In-Reply-To: <87r686rwmj.fsf@hubble.informatimago.com> (Pascal J. Bourguignon's message of "Sun\, 31 Aug 2008 00\:00\:52 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2.50 (darwin) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:57145 Archived-At: pjb@informatimago.com (Pascal J. Bourguignon) wrote: Another tip: Use `eval-after-load' a lot. With that you can load minor modes and configurations only when a specific major mode has been (auto-)loaded. I use this to load cedet only when cc-mode is loaded, for example. > - don't load what you need, yet. This means, instead of loading or > requiring the packages you may need, define autoloading functions. > Good packages will do that for you, when you require them, they load > only a file which defines autoloading functions, so you spend time > loading the package only when you try to run these functions. I don't think /good/ packages do that, just /huge/ packages. IHMO the proper thing for packages to do is just add ;;;###autoload markers, so /you/ can generate the autoloads automatically, if you want them (using `update-directory-autoloads'). Package managers like ELPA will do that step automatically when the package is updated. I actually find it annoying if packages have their own autoloading, because I need to exclude them specifically. Pretty much every other package I can autoload automatically with something like this: (My actual code is more complicated, so this is just a prototype...) (defun update-autoloads () (dolist (file (directory-files package-dir t "[^.]" t)) (when (file-directory-p file) (add-to-list 'loaddef-dirs file))) (add-to-list 'loaddef-dirs package-dir) (let ((generated-autoload-file autoload-file)) (apply 'update-directory-autoloads loaddef-dirs))) and then just (ignore-errors (load autoload-file)) I only need to define manual autoloads for three packages or so... regards, Nikolaj Schumacher