all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Luis Gerhorst <privat@luisgerhorst.de>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: monnier@IRO.UMontreal.CA, 30078@debbugs.gnu.org
Subject: bug#30078: 27.0.50; Use lexical-binding for M-:
Date: Sat, 13 Jan 2018 18:50:36 +0100	[thread overview]
Message-ID: <C07BC588-618F-4C7A-AD2A-BB2C8FF48E1D@luisgerhorst.de> (raw)
In-Reply-To: <87bmhyeqa5.fsf@web.de>

> On 12. Jan 2018, at 22:11, Michael Heerdegen <michael_heerdegen@web.de> wrote:
> 
> Ah, so you doubt that lexical-binding once should just be the default.
> Then I think we should discuss about this goal.

Here are a few possible pros of lexical binding:

1) Make Elisp more approachable to newcomers. Lexical binding is the default in most programming languages and thus more people are familiar with it. This makes it easier for people to understand existing code since they don‘t have to get used to implicit dynamic binding first, which the code may take advantage of.

2) Make existing code more maintainable. I was involved in porting the package emacs-eclim to lexical binding. The process shed light on some very dark parts of the codebase nobody had touched in a while since they were written in very bad style and thus hard to understand. Using lexical binding forced us to simplify those parts.

3) This is a minor one: I‘ve heard that lexical binding allows for more optimizations. I don‘t know to which extend this actually happens and whether it is noticeable to the user.

I believe 1) and 2) will significantly help improving the general quality of Elisp code and thus of Emacs in general.

Here‘s the big con:

If lexical binding should become the default one day, you would have to give everyone a reasonable amount of time (multiple years?) to adapt for it and port their code or set lexical binding to nil in their files.

One idea would be to make elisp-mode somehow encourage users to enable lexical binding in the files they are editing. Any ideas how this can be done without annoying users? Ideas:
- Prompting every time elisp-mode is enabled in a file that does not have a lexical binding header.
- I know that certain functions insert a apropriate copyright notice into el-files, do / can those also set lexical binding to t?

Best regards,
Luis





  reply	other threads:[~2018-01-13 17:50 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11 16:36 bug#30078: 27.0.50; Use lexical-binding for M-: Stefan Monnier
2018-01-11 20:58 ` Michael Heerdegen
2018-01-12 14:58   ` Stefan Monnier
2018-01-12 16:12     ` Stefan Monnier
2018-01-12 16:53       ` Glenn Morris
2018-01-12 17:23       ` Michael Heerdegen
2018-01-12 18:47         ` Stefan Monnier
2018-01-12 19:35           ` Michael Heerdegen
2018-01-13 17:58             ` Stefan Monnier
2018-01-12 18:34       ` Eli Zaretskii
2018-01-12 18:49         ` Stefan Monnier
2018-01-12 18:55           ` Eli Zaretskii
2018-01-12 19:06             ` Stefan Monnier
2018-01-12 20:03               ` Eli Zaretskii
2018-01-12 20:33                 ` Noam Postavsky
2018-01-12 20:55                 ` Michael Heerdegen
2018-01-12 21:04                   ` Eli Zaretskii
2018-01-12 21:11                     ` Michael Heerdegen
2018-01-13 17:50                       ` Luis Gerhorst [this message]
2018-01-13 19:48                         ` Eli Zaretskii
2018-01-13 20:19                           ` Luis Gerhorst
2018-01-14  5:58                           ` Robert Cochran
2018-01-13 18:19                     ` Stefan Monnier
2018-01-13 19:34                       ` Eli Zaretskii
2018-01-13 21:58                         ` Stefan Monnier
2018-01-13 23:18                       ` Richard Stallman
2018-01-14  2:07                       ` Drew Adams
2018-01-15  2:34                         ` Richard Stallman
2018-01-13 18:05                 ` Stefan Monnier
2018-01-13 19:37                   ` Eli Zaretskii
2018-03-19 19:32       ` Stefan Monnier
2018-03-19 19:34         ` Stefan Monnier
2018-03-19 20:10         ` Eli Zaretskii
2018-03-19 20:50           ` Stefan Monnier
2018-03-20  6:59             ` Eli Zaretskii
2018-03-20 19:20               ` Stefan Monnier
2018-04-02 19:40                 ` Richard Stallman
2018-04-03  0:12                   ` Stefan Monnier
2018-04-03 16:50                     ` Richard Stallman
     [not found] <mailman.7210.1515688689.27995.bug-gnu-emacs@gnu.org>
2018-01-12 16:28 ` nazienham

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

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

  git send-email \
    --in-reply-to=C07BC588-618F-4C7A-AD2A-BB2C8FF48E1D@luisgerhorst.de \
    --to=privat@luisgerhorst.de \
    --cc=30078@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.