From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.devel Subject: Re: Generalizing find-definition Date: Thu, 11 Dec 2014 22:53:37 +0100 Message-ID: <871to5svj2.fsf@engster.org> References: <20141102151524.0d9c665c@forcix> <85tx1amnyg.fsf@stephe-leake.org> <85egsem1u2.fsf@stephe-leake.org> <867fy0or7p.fsf@yandex.ru> <86ppbqn841.fsf@yandex.ru> <8761diro00.fsf@engster.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1418334850 12342 80.91.229.3 (11 Dec 2014 21:54:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Dec 2014 21:54:10 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 11 22:54:04 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XzBgR-0003tS-Is for ged-emacs-devel@m.gmane.org; Thu, 11 Dec 2014 22:54:03 +0100 Original-Received: from localhost ([::1]:54463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzBgP-0002Gs-6J for ged-emacs-devel@m.gmane.org; Thu, 11 Dec 2014 16:54:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzBgG-0002Cz-5e for emacs-devel@gnu.org; Thu, 11 Dec 2014 16:53:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzBg9-0007vg-ID for emacs-devel@gnu.org; Thu, 11 Dec 2014 16:53:52 -0500 Original-Received: from randomsample.de ([5.45.97.173]:42631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzBg9-0007v9-9K for emacs-devel@gnu.org; Thu, 11 Dec 2014 16:53:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=px9AsyGkpJfJcA3DANJpE3STNzOYd714OuXWA53yOgs=; b=o7RJRm9f/VZ8wM3pv/1z7tt9Yss/LfQWsSaCeBWaA89eMfxZzpdA8YlrzHi7fyDg+mLSKwu6VR6tTn9+o5RK+eGzfbgcuYYtnzDlhy8Do4g24jezSDmCgyjqLlSFffQg; Original-Received: from ip4d154cb9.dynamic.kabel-deutschland.de ([77.21.76.185] helo=spaten) by randomsample.de with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XzBg6-0005YY-Jz; Thu, 11 Dec 2014 22:53:42 +0100 In-Reply-To: (Helmut Eller's message of "Thu, 11 Dec 2014 20:36:24 +0100") User-Agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 5.45.97.173 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:179841 Archived-At: Helmut Eller writes: > On Thu, Dec 11 2014, David Engster wrote: > >> Helmut Eller writes: >>>> Too bad that classes can't be autoloaded. >> >> They can. CEDET does that all the time. > > Ah, that's great! > >>> ;;;###autoload (autoload 'etags-xref-backend "etags") >>> (defclass etags-xref-backend (xref-backend-class eieio-singleton) ()) >> >> Uhm, did you try to simply putting ";;;###autoload" before a class >> definition? It should work just fine (through >> `eieio-defclass-autoload'). > > Yes, I tried but got this error: > > ... > Loading loaddefs.el (source)... > Attempt to autoload eieio-defclass-autoload while preparing to dump > make[1]: *** [emacs] Error 1 EIEIO is not available at startup. You have to explicitly 'require' it before autoloading of classes can work. >> However, there *is* a problem with autoloading classes, namely that >> EIEIO should not be loaded at Emacs startup. This is why this feature is >> currently restricted to the CEDET subsystem which is only loaded when >> you activate Semantic or EDE. > > So what's the recommended way to do it for a file in lisp/progmodes/ ? The only way is to separate everything that needs EIEIO into a separate file with its own autoloads. This usually does not make sense for a small package, though. So really, the best way is to have one central autoload for your package (usually a major/minor mode). -David