Lute Kamstra <[EMAIL PROTECTED]> writes: > David Kastrup <[EMAIL PROTECTED]> writes: > >> The function that _clearly_ should trigger/use the recorded >> information, however, is "require". > > Agreed. > >> I don't think we need to make (load "filename") (unload-feature >>'filename) do anything sensible (and indeed it is legal to load the >>same file several times in succession), but it seems desirable to >>have (require 'filename) (unload-feature 'filename) form a proper >>pair. > > I'm not sure if it's the best solution not to let (load "filename") > record autoloads.
Well, the idea explored a bit later later was that "load" will record autoloads, but not do anything with them by itself, instead letting "provide" handle it. > But letting only (require 'filename) record autoloads would be a big > improvement. My guess is that the vast majority of files get loaded > by do_autoload and Frequire. Furthermore, it seems quite easy to > implement the recording of autoloads in Frequire. I'll give it a > try and experiment with it for a while... > >> Unfortunately, this does not work well with the site-lisp.el >> construct >> (mapc 'load-file (directory-files "site-start.d" t ".el\\'")) >> >> So a better expedient would be to have >> (provide 'xxx) >> >> turn on the necessary action at the end of the current load file in >> case that the feature is provided the first time. >> >> This should be a pretty reliable way to do the recordings for files >> that are connected with a "feature". > > I'm not familiar with this. Could you elaborate? Many Emacs installations have a site-lisp/site-start.d directory. If you want some code executed automatically (usually a bunch of autoloads), then you'll drop the .el file in that directory. > When is this used? Does it load files that define functions that > replace autoloads? I guess the most common case would be loading files that _place_ autoloads and add stuff to hook functions. And it usually is a bunch of stuff that the system administrator thought good for you. For example, if you install a prepackaged foobar package from your favorite distribution, then this will drop foobar.el into site-lisp/site-start.d/ and foobar.el will then setup the package foobar with autoloads and similar. If the wisdom of the system provider did not match your personal tastes, being able to (unload-feature 'foobar) would be definitely nice. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel