Subject: Re: bug#66750: Unhelpful text in C-h v for variables with a lambda form as value

From: Alan Mackenzie <[email-masked]>
Date: Sat, 28 Oct 2023 09:27:15 +0000

Hello, Andrea.

On Fri, Oct 27, 2023 at 11:35:16 +0000, Alan Mackenzie wrote:

> On Wed, Oct 25, 2023 at 16:53:38 -0400, Andrea Corallo wrote:
> > Alan Mackenzie <[email-masked]> writes:

[ .... ]

> > > I see two ways to fix this bug:
> > > (i) Systematically to replace each of these lambda functions by a named
> > >   defun.
> > > (ii) To adopt git branch feature/named-lambdas, which attaches to every
> > > lambda function the name of the defun (or defvar) in which it was
> > > defined.  This extra information could then be printed out for C-h v,
> > > something like this:

> > >     Its value is
> > >     {isearch-fold-quotes-mode} #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_109>
> > >     Original value was nil
> > >     Local in buffer *info*<3>; global value is nil

> > > , thus enabling the user quickly to locate the source of the lambda form
> > > in isearch.el.

> > Hi Alan,

> > what (if any) do you think are the downsides of option ii?

> Currently feature/named-lambdas is mostly working, not fully working.
> Probably the most pressing of these deficiencies is that native compiled
> lambda functions don't yet get their defining symbol set.

They do now.  In feature/named-lambdas, I now see C-h v
search-default-mode giving the above display when invoked from an info
buffer.

> There have been substantial amendments compared with the master branch,
> and it has not been tested much by anybody but me.

> Assuming it can be brought to a fully working state, there would be an
> extra symbol in each function definition which would make Emacs
> marginally bigger.

> > Thanks

> >   Andrea

-- 
Alan Mackenzie (Nuremberg, Germany).