emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file-requires does not reflect source file changes, even after file


From: Stefan Monnier
Subject: Re: file-requires does not reflect source file changes, even after file is loaded
Date: Wed, 19 Oct 2005 17:16:49 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> BTW, the list of features returned from this function is a list of
> _strings_, not symbols, so features are apparently also sometimes
> represented by strings.

Sounds like a bug to me.

> Your answer is in terms of how file-requires is implemented (and the
> structure of load-history).  The behavior (what it does, not how it does
> it) should be documented in the doc string.  Thanks for the
> explanation, though.

I was explaining the bug, not describing the ideal or documented behavior.

> Beyond the lack of doc - is that really the behavior we want?

Probably not.

> Why is loading a source file treated differently from loading
> a byte-compiled file

It's not, except that if you say "test" and both "test.el" and "test.elc"
are present, "test.elc" is used.

> - that is, why are there two separate entries in load-history?

Because you loaded "two different files": "test" and "test.el".
Depending on the presence or absence of test.elc and test.el the two may
or may not actually correspond to the same file.

> And why is the entry for test.el different, depending on
> whether or not a test.elc exists?

>     If instead of "load-library test.el" you
>     remove the .elc
>     file and then do "load-library test" (which will load the test.el file)
>     you'll get the answer you want.

> Yes, I mentioned that: when there is no .elc the .el is used. I suppose this
> means that in that case the load-history entry is not test.el, but test - or
> else some code massages things and deals with this as a special case.

The load-history entry remembers the exact string you passed to `load',
rather than the actual name of the file that got loaded.  Whether that's
right or not I can't say (IIRC XEmacs made the other choice).

> But nothing is said in the file-requires doc string about the its behavior.
> The doc string doesn't even mention load-history. If the behavior is to stay
> as it is, then the file-requires doc string should have an explanation,
> analogous (though this is not the same thing) to the explanation about .el
> and .elc in the doc string of load.

Everything that uses load-history is pretty brittle.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]