[Top][All Lists]
[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 15:29:27 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> `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).
Features are represented by symbols, but files are never represented by
symbols in Emacs, only by strings.
> 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")
The issue is not "byte-compiled vs non-byte-compiled", but just that the
load-history has 2 entries: one for "test" (corresponding to test.elc) and
one for "test.el". If you do (file-requires "test") you'll get the info
about the first, while if you do (file-requires "test.el") you'll the info
about the second. 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.
Similar problems show up if you do M-x load-library RET test RET and later on
do M-x load-library RET /path/to/test RET.
Stefan
Re: file-requires does not reflect source file changes, even after file is loaded, Richard M. Stallman, 2005/10/20