Compiled function annotations.
Ben Wing
ben at xemacs.org
Mon Feb 8 22:45:49 EST 2010
On Mon, Feb 8, 2010 at 8:05 AM, Aidan Kehoe <kehoea at parhasard.net> wrote:
>
> Ar an triú lá de mí Feabhra, scríobh Ben Wing:
>
> > add more byte-code assertions and better failure output
> >
> > -------------------- ChangeLog entries follow: --------------------
> >
> > src/ChangeLog addition:
> >
> > 2010-02-03 Ben Wing <ben at xemacs.org>
>
> > [...]
> > Turn on the "compiled-function annotation hack". Implement it
> > properly by hooking into Fdefalias(). Note in the docstring to
> > `defalias' that we do this.
>
> [...]
>
> > [...]
> > @@ -716,12 +718,19 @@
> > DEFUN ("define-function", Fdefine_function, 2, 2, 0, /*
> > Set SYMBOL's function definition to NEWDEF, and return NEWDEF.
> > Associates the function with the current load file, if any.
> > +If NEWDEF is a compiled-function object, stores the function name in
> > +the `annotated' slot of the compiled-function (retrievable using
> > +`compiled-function-annotation').
> > */
>
> This is noticeably different from what the compiled function annotations
> used to do, and breaks help.el, which says, e.g. that #'eql was loaded from
> `eql'. What’s the upside here? Just that the function name is available in
> the function object? If you have a compiled function object, and an idea of
> what directory it was loaded from, you can grep for the constants vector or
> some sufficiently distinct subset of it in the .elc files, and that’ll tell
> you where it was defined.
I wrote the annotation hack originally and it was always designed to
put the function name in the compiled function object. This way it
makes backtraces more readable -- the print method for compiled
functions automatically prints the annotation. I don't know where
that code in help.el came from. It might have been this: If the
function name couldn't be identified by the very hacky method formerly
used in lread.c, the filename was substituted. Then compiled code was
changed to use `defalias' instead of `fset', and the filename would
always be substituted -- then someone saw this and wrote the code in
help.el.
I just deleted the code -- load-history does the trick fine.
More information about the XEmacs-Patches
mailing list