From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.help Subject: Re: eieio persistent, plus autoloads Date: Fri, 16 Aug 2013 17:18:23 +0200 Message-ID: <87fvu9psu8.fsf@arcor.de> References: <87siybjkpy.fsf@ericabrahamsen.net> <87vc37os66.fsf@arcor.de> <87ppteie8a.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1376666345 20252 80.91.229.3 (16 Aug 2013 15:19:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Aug 2013 15:19:05 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 16 17:19:06 2013 Return-path: Envelope-to: geh-help-gnu-emacs@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 1VALnt-0002Ms-8w for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Aug 2013 17:19:05 +0200 Original-Received: from localhost ([::1]:59620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VALns-0003y0-QV for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Aug 2013 11:19:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VALna-0003xg-IO for help-gnu-emacs@gnu.org; Fri, 16 Aug 2013 11:18:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VALnT-00039K-8L for help-gnu-emacs@gnu.org; Fri, 16 Aug 2013 11:18:46 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:55490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VALnT-000394-2u for help-gnu-emacs@gnu.org; Fri, 16 Aug 2013 11:18:39 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VALnR-0001xq-CQ for help-gnu-emacs@gnu.org; Fri, 16 Aug 2013 17:18:37 +0200 Original-Received: from dslc-082-083-032-227.pools.arcor-ip.net ([82.83.32.227]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Aug 2013 17:18:37 +0200 Original-Received: from deng by dslc-082-083-032-227.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Aug 2013 17:18:37 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 53 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslc-082-083-032-227.pools.arcor-ip.net User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) Mail-Copies-To: never Cancel-Lock: sha1:8tLgr3zI7EtYxAcWFJ+s40lLZhA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92933 Archived-At: Eric Abrahamsen writes: > That doesn't work because when users or third-party package managers > want to subclass, say, the bbdb-field class, they would have to remember > to do this: > > ;;;###autoload (eieio-defclass-autoload 'my-field-class "thisfile.el") A plain ;;;###autoload is enough; the autoload-updating mechanism will see that it is for a defclass. Otherwise: Yes, the package maintainer should put an autoload comment on functions which are likely to be used before the package is loaded, and the same best practice applies to classes. I don't see this being specific to EIEIO. In general, how do you make sure a package is loaded before you use it? In Emacs, you usually require it in your .emacs; for big packages, like Gnus or CEDET, that require simply loads a file filled with autoloads, which were generated during their compilation. For small packages, it is usually tolerable to simply load the whole thing on startup. (I happen to create an autoload file for all those little packages, but I think that's pretty unusual, and I also wouldn't recommend it to people unfamiliar with Emacs autoloads.) > It just seems a lot safer to have something automatic. No, on the contrary. One package fiddling with autoloads from another package is asking for trouble. What if I happen to load a package and it creates a class which inherits from bbdb-field, and I don't even know that? If would put a permanent autoload into my BBDB setup, that would annoy me immensely. What happens if I remove that package? > So I was thinking either hot-wire `defclass' (probably with advice) >, or provide a special macro for subclassing these classes. But both of >those solutions have the same problem: as far as I can tell, calling >`eieio-defclass-autoload' in a program, followed by >`update-file-autoloads', does *not* write anything to a loaddef file, >that only happens when compiling a file with autoload cookies in it. Yes, it's the same with plain `autoload'. `update-file-autoloads' is just a mechanism so that you don't have to manually write and maintain a file containing all the autoloads of your package. > So... now I'm thinking that, if I really want to insist on this, I'll > still go the macro route, but just use some of the bits and pieces from > autoload.el and cobble together something semi-manual. IMHO it's really simple: If you're using a third-party package which extends BBDB, it has to be loaded before you load your bbbdb file. The user should take care of that, and I don't think that's asking too much. :-) -David