Makefile dependency generation for elisp files?

SL Baur steve at xemacs.org
Thu Apr 24 22:47:33 EDT 2008


On 4/24/08, Robert Widhopf-Fenk <hack at robf.de> wrote:
> On Thursday, April 24, 2008 at 09:53:12, Stephen Turnbull wrote:

>  > No.  elisp is designed to make this difficult and unreliable.
>  >
>  > It is possible to construct a graph of requires, but a require that
>  > is not listed in the package Makefile REQUIRES variable will also be
>  > reported as a fatal error when attempting to build.
>  >
>  > However, Lisp code that calls a function that is not defined at load
>  > time or compile time is legal by design, so there is no way (except
>  > to keep a database of all functions ever defined anywhere) to
>  > determine whether a function that is called is a dependency, and if
>  > so, it is not possible to determine where it was defined.
>  >
>  > Consider:
>  >
>  > (condition-case nil
>  >     (who-knows-if-i-am-defined--try-me-and-find-out!)
>  >   (error
>  >     (all-hail-rms)))
>  >
>  > Various people have tried to do a "good-enough" job over the years,
>  > but with little success; it seems to be more trouble than it is
>  > worth.
>
>
> Gosh, I was expecting such an answer ;-)

This is a feature, not a bug.  `all-hail-rms' because of the instability of
the FSF Emacs API - if you must have portable code across many
emacsen, it's impossible to avoid referencing impossible-to-call
functions and void variables in some fashion.

It's also useful to be able to define and call functions that are created
after your code has begun to execute.  Lisp isn't the sort of language
suitable for that kind of static analysis, nor should it be.

-sb



More information about the XEmacs-Beta mailing list