unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Alan Mackenzie <acm@muc.de>
Cc: Eli Zaretskii <eliz@gnu.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
Subject: Re: lexical-binding is turned on in more use cases
Date: Wed, 11 Mar 2020 00:41:59 +0100	[thread overview]
Message-ID: <87eetz4w1k.fsf@web.de> (raw)
In-Reply-To: <20200310215334.GG5046@ACM> (Alan Mackenzie's message of "Tue, 10 Mar 2020 21:53:34 +0000")

Alan Mackenzie <acm@muc.de> writes:

> Would you perhaps like to give me such an example?

Well - anything that relies on lexical-binding.  You can use any
playground example, like

(defun my-make-counter ()
  (let ((counter 0))
    (lambda () (setq counter (1+ counter)))))

(setq mc (my-make-counter))

(funcall mc) => 1
(funcall mc) => 2 ; etc.

If you eval (my-make-counter) with lexical-binding off, the result is
not functional.  If the expression to eval defines/binds something
important, this will error or even break a package.

> And I'm angry that such a far reaching change was pushed through without
> open discussion beforehand on emacs-devel.  This seems to happen far too
> often in Emacs development.

Were does M-: break for you with the change?

> I have recently proposed that the lexicality of bindings created in M-:
> (etc.) should be determined by a customisation variable, and have
> offered to code it up.  Would you find this a good solution?

I guess not.

AFAIU scratch has lexical binding on now, I think this is good.  M-:
used to use the lexical binding mode from the buffer it had been called.
Dunno if an alternative would be to turn on lexical binding in more
buffers instead.

But my guess is that you will also not get lucky if you start to get in
touch with code that relies on lexical binding (it gets more) and
customize the new option to turn lexical binding off for evaluation.


Michael.



  reply	other threads:[~2020-03-10 23:41 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-07 11:29 lexical-binding is turned on in more use cases Eli Zaretskii
2020-03-08 16:35 ` Stefan Monnier
2020-03-08 17:01   ` Eli Zaretskii
2020-03-08 17:33     ` Stefan Monnier
2020-03-08 17:43       ` Eli Zaretskii
2020-03-08 18:20         ` Stefan Monnier
2020-03-08 18:34           ` Eli Zaretskii
2020-03-08 19:30             ` Alan Mackenzie
2020-03-08 19:40               ` Eli Zaretskii
2020-03-08 19:56                 ` Alan Mackenzie
2020-03-08 20:06                   ` Eli Zaretskii
2020-03-08 20:15                     ` Alan Mackenzie
2020-03-11  2:59                       ` Richard Stallman
2020-03-11 12:44                       ` Stefan Monnier
2020-03-08 23:41                 ` Stefan Monnier
2020-03-08 23:41               ` Stefan Monnier
2020-03-09 20:10                 ` John Wiegley
2020-03-09 21:18                   ` Stefan Monnier
2020-03-09 21:27                     ` Drew Adams
2020-03-09 21:43                       ` Stefan Monnier
2020-03-09 22:30                     ` John Wiegley
2020-03-10 19:13                     ` Alan Mackenzie
2020-03-10 19:49                       ` Andrea Corallo
2020-03-10 20:16                         ` Alan Mackenzie
2020-03-10 20:54                           ` Andrea Corallo
2020-04-07 23:28                             ` Bruno Félix Rezende Ribeiro
2020-03-10 20:41                       ` Stefan Monnier
2020-03-10 21:02                         ` Michael Heerdegen
2020-03-10 21:02                         ` Alan Mackenzie
2020-03-10 21:33                           ` Stefan Monnier
2020-03-11  3:22                           ` Eli Zaretskii
2020-03-10 21:14                       ` Michael Heerdegen
2020-03-10 21:53                         ` Alan Mackenzie
2020-03-10 23:41                           ` Michael Heerdegen [this message]
2020-03-11  1:36                             ` Noam Postavsky
2020-03-11  2:02                               ` Michael Heerdegen
2020-03-13  0:46                                 ` Noam Postavsky
2020-03-11  3:06                             ` Richard Stallman
2020-03-11 12:47                               ` Stefan Monnier
2020-03-13  2:32                                 ` Michael Heerdegen
2020-03-11  2:11                           ` Stefan Monnier
2020-03-11 22:39                           ` John Wiegley
2020-03-09 20:22                 ` Alan Mackenzie
2020-03-09 22:05                   ` Stefan Monnier
2020-03-10 18:41                     ` Alan Mackenzie
2020-03-10 19:05                       ` Stefan Monnier
2020-03-10 19:41                         ` Alan Mackenzie
2020-03-10 20:26                           ` Stefan Monnier
2020-03-10 20:44                             ` Alan Mackenzie
2020-03-10 21:30                               ` Stefan Monnier
2020-03-11  3:06                               ` Richard Stallman
2020-03-08 19:39             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eetz4w1k.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).