David Kastrup <[EMAIL PROTECTED]> writes: > Lute Kamstra <[EMAIL PROTECTED]> writes: > >> David Kastrup <[EMAIL PROTECTED]> writes: >> >>> Lute Kamstra <[EMAIL PROTECTED]> writes: >>> >>>> Consider the following situation: >>>> >>>> function 'a is autoloaded: (autoload "blabla" ...). >>>> function 'b is autoloaded: (autoload "other" ...). >>>> function 'c is defined. >>>> function 'd is unbound. >>>> >>>> "blabla" defines 'a, 'b, 'c, and 'd as functions. >>>> >>>> Do (require 'blabla) and then (unload-feature 'blabla). >>>> >>>> Currently, all four functions will be unbound by unload-feature. >>>> You propose to let unload-feature restore both 'a and 'b to their >>>> previous autoloads [1]. >>> >>> Sure. >>> >>>> But what should be done with 'c? >>>> >>>> I think restoring 'c to its previous definition would be the right >>>> thing to do. >>> >>> Not at all. The purpose of unload-feature is to be able to restore >>> a state, most particular to conserve memory. So unload-feature >>> should not waste memory by keeping in effect a history of load >>> sequences around. Its purpose should be confined to unloading >>> those features that _can_ reasonably be unloaded. And that means >>> no functions whatsoever that _redefine_ stuff. The main purpose of >>> the autoload restoration is to restore autoloads into the package >>> itself, not foreign autoloads. >> >> For me, it is most intuitive/logical that unload-feature tries to >> undo the effects of loading the feature. > > If it can. > >> It is very uncommon that a feature redefines a function (or a >> variable), so keeping track of such cases will not waste much >> memory. > > But it is very common that one loads and evals one and the same file > over and over. We don't want to keep a history of that.
I had not considered that. Does loading the same file more than once really happen often? On purpose? For what reason? If files do get reloaded often (for good reasons), then recording old values of functions and variables should probably be done only if require loads a file. That wouldn't happen twice. Lute. _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel