From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: formido Newsgroups: gmane.emacs.help Subject: Re: How to Reduce Emacs Load Time Date: Sun, 31 Aug 2008 10:50:48 -0700 (PDT) Organization: http://groups.google.com Message-ID: <522d43dc-04dd-4700-8064-d5b438339554@s20g2000prd.googlegroups.com> 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=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1220208099 3335 80.91.229.12 (31 Aug 2008 18:41:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Aug 2008 18:41:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 31 20:42:33 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 1KZrse-00036V-CK for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Aug 2008 20:42:32 +0200 Original-Received: from localhost ([127.0.0.1]:38108 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZrre-0004Z9-TH for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Aug 2008 14:41:30 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!s20g2000prd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 102 Original-NNTP-Posting-Host: 75.84.175.111 Original-X-Trace: posting.google.com 1220205049 32207 127.0.0.1 (31 Aug 2008 17:50:49 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 31 Aug 2008 17:50:49 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s20g2000prd.googlegroups.com; posting-host=75.84.175.111; posting-account=ivEBWwoAAAAvVw947tp2U-HBcoAwWEMu User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:161811 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:57154 Archived-At: On Aug 31, 4:26 am, Nikolaj Schumacher wrote: > p...@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. Haha! I see others have mentioned cedet, too. That's the package that's causing me the most pain. See, I just followed cedet's .emacs setup instructions, and I went with the whole kit and kaboodle by using the load-excessive-helper-functions or whatever. My .emacs looks like: (load "lisp/cedet-1.0pre4/common/cedet.elc") (semantic-load-enable-excessive-code-helpers) So, when Emacs starts up, the relevant sections of *messages* looks like this: Loading lisp/cedet-1.0pre4/common/cedet.elc... "/Users/formido/.emacs.d/lisp/cedet-1.0pre4/common/" added to `load- path' "/Users/formido/.emacs.d/lisp/cedet-1.0pre4/cogre" added to `load- path' "/Users/formido/.emacs.d/lisp/cedet-1.0pre4/ede" added to `load-path' "/Users/formido/.emacs.d/lisp/cedet-1.0pre4/eieio" added to `load- path' "/Users/formido/.emacs.d/lisp/cedet-1.0pre4/semantic" added to `load- path' "/Users/formido/.emacs.d/lisp/cedet-1.0pre4/speedbar" added to `load- path' "/Users/formido/.emacs.d/lisp/cedet-1.0pre4/contrib" added to `load- path' Setting up cedet...done Setting up cogre...done Setting up ede... Loading ede... Loading ede-speedbar...done Loading ede...done Setting up ede...done Setting up eieio...done Setting up semantic...done Setting up speedbar...done Setting up cedet-contrib...done Loading lisp/cedet-1.0pre4/common/cedet.elc...done Loading semantic-idle...done Loading senator...done WARNING: Probable vocabulary misuse ahead... I could set cedet to load when a feature I know about is activated, like cc-mode, but I'm worried that with everything going on above, all sorts of features and hooks are being set up that I'll then never find out about. I would have thought that they'd just set up hooks to autoload functions as necessary. Is all the above necessary just for that? - Hide quoted text - - Show quoted text - > > - 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)) My elisp-foo is still weak: if I understand right, this function only works if the packages have been tagged with appropriate metadata, i.e., autoload markers? > I only need to define manual autoloads for three packages or so... > regards, > Nikolaj Schumacher Michael