Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!sri-unix!rutgers!mit-eddie!YALE.ARPA!ram-ashwin From: ram-ashwin@YALE.ARPA (Ashwin Ram) Newsgroups: comp.emacs Subject: Re: Loading files if not already loaded... Message-ID: <8708201300.AA17564@ATHENA.CS.YALE.EDU> Date: Thu, 20-Aug-87 09:00:53 EDT Article-I.D.: ATHENA.8708201300.AA17564 Posted: Thu Aug 20 09:00:53 1987 Date-Received: Sat, 22-Aug-87 10:01:57 EDT Sender: daemon@eddie.MIT.EDU Lines: 37 You're right, I didn't state my point clearly. What I was trying to get at was this. Suppose my "wonderful-function" used a set of other wonderful functions that were part of a package. For example, suppose I wrote an rmail-like package that used a bunch of rmail functions, plus defined some new ones. Now, it would be nice if my package could just require the original rmail file, rather than autoloading each of these functions from that rmail file. If the rmail file doesn't provide a feature (I know rmail does, but many files don't), this is hard to do. You can either autoload each individual function you need (a pain), or you have to load the file (and have it reloaded again if you need this file for another package too). One simple solution would be to make each file automatically provide the name of the file itself as one of the features it provides (in addition to explicit provides in the file). Then you can easily require the file using existing require/provide mechanisms (which by the way I think are really neat). A related point: I think: (if (not (fboundp 'wonderful-function)) (require "wonderful-feature")) ; with optional wonderful-file is a cleaner way to do autoloads than: (if (not (fboundp 'wonderful-function)) (load "wonderful-file")) Since require's filename defaults to the feature name, the former is strictly more powerful than the latter. This gives you a way to do package dependencies in a slightly nicer way than autoload does. -- Ashwin. ARPA: Ram-Ashwin@cs.yale.edu UUCP: {decvax,linus,seismo}!yale!Ram-Ashwin BITNET: Ram@yalecs