[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
file-requires does not reflect source file changes, even after file is l
From: |
Drew Adams |
Subject: |
file-requires does not reflect source file changes, even after file is loaded |
Date: |
Wed, 19 Oct 2005 10:32:14 -0700 |
`file-requires' doc string says only this: "Return the list of features
required by FILE." First problem: it doesn't even say anything about the
form of the FILE argument (string, not symbol).
However, it looks like `file-requires' only notices a byte-compiled file
that is loaded, not the corresponding source file. It notices a source file
that has no associated .elc, but not one that has a .elc.
At the least, the doc string is incomplete (misleading). If you make a
source file change, and then load the source file, `file-requires' continues
to report the status of the out-of-date .elc.
emacs -q
1. Put files test.el , foo.el, and bar.el in load-path. Put `provide's in
foo and bar. Put (require 'foo) in test.el. Byte-compile test.el.
2. load-library loadhist (so you can use `file-requires')
3. load-library test
4. M-: (file-requires "test") shows ("foo")
5. Edit test.el so it requires bar instead of foo.
6. load-library test.el (source file, not .elc)
7. M-: (file-requires "test") still shows ("foo")
This might be the designed behavior, but it is not documented in the doc
string of `file-requires'.
Personally, I would prefer that `file-requires' always reflect the status of
the library as last loaded - "the list of features required by FILE" -
whether .el or .elc was loaded. But I foresee the argument that if you have
both .el and .elc you should keep .elc up-to-date for things like
`file-requires' to work. If that's the approach, then the doc string should
reflect that behavior.
- file-requires does not reflect source file changes, even after file is loaded,
Drew Adams <=
Re: file-requires does not reflect source file changes, even after file is loaded, Richard M. Stallman, 2005/10/20