Subject: RE: bug#33164: 26.1; Compiled function information in *Help*

From: Drew Adams <[email-masked]>
Date: Sun, 28 Oct 2018 07:17:29 -0700 (PDT)

> In this case, the link to `simple.el' takes you there because it's the
> default value.  But in general, no, that information is not saved
> anywhere.

Yes, what you say makes sense.  I guess I am wondering whether
the byte-compiler might (be made to) record the source in the
byte-compiled function definition.  A byte-compiled file
records the absolute name of the source file, as well as the
Emacs release/build and the time of the compilation (creation
of the .elc).

Perhaps some "source" location information could be recorded
in the byte-code, and be retrievable by a help function?
In the case of a source definition in a file, the info could
be similar to what we record in a .elc.  But perhaps even if
the source code were in a buffer, or even via `M-:', perhaps
some textual indication/description of that source could be
recorded, along with the date & time.

Just a thought.  Yes, that would increase byte-code size,
and it should anyway be optional I guess.  But it might
allow for a little more introspection than what we can get
now (disassembled code).

If you want to recast this bug report as an enhancement
request along those lines, perhaps (again) retitling, please
do so.

> The easiest fix is to say we should never assign anonymous functions to
> variables (there have already been a couple of cases where some
> anonymous function values were given names), so then they would all show
> a symbol like comment-line-break-function.

That would not be something I'd ask for or appreciate.
I want to be able to get more info about existing function
values, not reduce the types of function values we can
assign to variables.

It can be helpful for help functions if someone uses a
symbol (providing a name and perhaps a source location),
but users need to be able to define and assign code as
values on the fly.  The idea of this report is to ask
for possible improvement in the introspection of byte-code
values - specifically time and location of definition.