bug#38835: 27; Recreated *scratch* buffer has lexical-binding = nil

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#38835: 27; Recreated *scratch* buffer has lexical-binding = nil

Mattias Engdegård-2
The standard *scratch* buffer is blessed with lexical-binding = t, but if killed and recreated via C-x b *scratch* RET, the new buffer isn't.

Not sure where this logic belongs; the *scratch* handling seems a bit spread out. In Fset_buffer_major_mode?




Reply | Threaded
Open this post in threaded view
|

bug#38835: 27; Recreated *scratch* buffer has lexical-binding = nil

Eli Zaretskii
> From: Mattias Engdegård <[hidden email]>
> Date: Tue, 31 Dec 2019 16:52:18 +0100
>
> The standard *scratch* buffer is blessed with lexical-binding = t, but if killed and recreated via C-x b *scratch* RET, the new buffer isn't.
>
> Not sure where this logic belongs; the *scratch* handling seems a bit spread out. In Fset_buffer_major_mode?

Maybe we should have a command to recreate *scratch*, and call it from
startup.el?  Then that command could do this.

Or maybe we should decide that lisp-interaction-mode should do this
for any buffer?



Reply | Threaded
Open this post in threaded view
|

bug#38835: 27; Recreated *scratch* buffer has lexical-binding = nil

martin rudalics
 > Maybe we should have a command to recreate *scratch*, and call it from
 > startup.el?  Then that command could do this.

'other_buffer_safely' would need it too.

martin



Reply | Threaded
Open this post in threaded view
|

bug#38835: 27; Recreated *scratch* buffer has lexical-binding = nil

Mattias Engdegård-2
In reply to this post by Eli Zaretskii
1 jan. 2020 kl. 17.14 skrev Eli Zaretskii <[hidden email]>:

> Or maybe we should decide that lisp-interaction-mode should do this
> for any buffer?

Yes, that seems to be the best and simplest choice.  Patch OK for emacs-27?


0001-Always-use-lexical-binding-in-lisp-interaction-mode-.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#38835: 27; Recreated *scratch* buffer has lexical-binding = nil

Eli Zaretskii
> From: Mattias Engdegård <[hidden email]>
> Date: Mon, 13 Jan 2020 14:57:29 +0100
> Cc: [hidden email]
>
> > Or maybe we should decide that lisp-interaction-mode should do this
> > for any buffer?
>
> Yes, that seems to be the best and simplest choice.  Patch OK for emacs-27?

Yes, but this needs a NEWS entry, and please see if we say enough
about lisp-interaction-mode and/or lexical-binding to mention this in
the manual as well.

Thanks.



Reply | Threaded
Open this post in threaded view
|

bug#38835: 27; Recreated *scratch* buffer has lexical-binding = nil

Mattias Engdegård-2
13 jan. 2020 kl. 17.30 skrev Eli Zaretskii <[hidden email]>:

> Yes, but this needs a NEWS entry, and please see if we say enough
> about lisp-interaction-mode and/or lexical-binding to mention this in
> the manual as well.

New patch. The existing NEWS entry was rephrased slightly, and a sentence added to the elisp manual.


0001-Always-use-lexical-binding-in-lisp-interaction-mode-.patch (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#38835: 27; Recreated *scratch* buffer has lexical-binding = nil

Eli Zaretskii
> From: Mattias Engdegård <[hidden email]>
> Date: Mon, 13 Jan 2020 18:04:22 +0100
> Cc: [hidden email], [hidden email]
>
> > Yes, but this needs a NEWS entry, and please see if we say enough
> > about lisp-interaction-mode and/or lexical-binding to mention this in
> > the manual as well.
>
> New patch. The existing NEWS entry was rephrased slightly, and a sentence added to the elisp manual.

Thanks, LGTM.



Reply | Threaded
Open this post in threaded view
|

bug#38835: 27; Recreated *scratch* buffer has lexical-binding = nil

Mattias Engdegård-2
Thank you, pushed to emacs-27.