Subject: Re: bug#52063: 28.0.60; Confusing presentation of lambda

From: Filipp Gunbin <[email-masked]>
Date: Wed, 24 Nov 2021 19:40:16 +0300

On 24/11/2021 16:38 +0200, Eli Zaretskii wrote:

>> From: Lars Ingebrigtsen <[email-masked]>
>> Cc: [email-masked],  [email-masked]
>> Date: Wed, 24 Nov 2021 14:31:22 +0100
>>
>> If you put
>>
>> (lambda () 1)
>>
>> into *scratch* and then `C-u C-x C-e' it'll spit put
>>
>> (closure (t) nil 1)
>>
>> Because that's what that form evaluates to in lexically bound buffers.
>> `lambda' is no longer self-evaluating, and hasn't been for a few years.
>>
>> (But I guess it's pretty recent that *scratch* defaults to lexical.)
>>
>> And it's the same with
>>
>> (lambda ()
>>   (setq flyspell-generic-check-word-p
>> 	'mail-mode-flyspell-verify))
>>
>> of course.
>
> I'm asking why we are doing this.  IT IS CONFUSING!!!

But you're creating normal lambda here, and under lex-bind it will
become a closure, to keep its lexical environment together with it.  In
your case there's nothing in lex environment, so that's it.

I just realized that I don't have lex-binding turned on in .emacs, and
because of that my customized hooks look "good", but I wonder: what is
the recommended binding mode for .emacs?  Dynamic or lexical?  With
lexical, all customizations would start to look as your example.