Skip to content

WIP: Use Emacs built-in lexical bindings everywhere instead of `lexical-let`

The meat of this MR is to remove lexical-let macros from Michelson-mode. This MR builds on !2012 (merged)

Context

As stated by: https://www.gnu.org/software/emacs/manual/html_node/cl/Obsolete-Lexical-Binding.html

lexical-let & lexical-let* are obsolete macros since Emacs 24.1, which supports true lexical-binding.

This commit removes them since lexical binding is enabled in the file.

Additionally 'let' instead of 'lexical-let' needs code reindentation. It is applied to the whole file.

After a more careful reading, it seems all lets in michelson-mode are actually lexicals in nature, except for the one binding defvar-variables. Enabling lexical-lets actually preserves the dynamic behaviors of these variables.

From https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Lexical-Binding.html#Using-Lexical-Binding

Even when lexical binding is enabled, certain variables will continue to be dynamically bound. These are called special variables. Every variable that has been defined with defvar, defcustom or defconst is a special variable (see Defining Variables). All other variables are subject to lexical binding.

Manually testing the MR

Nothing should change w.r.t to michelson-mode

Reviewers

@rafoo_

Edited by Richard Bonichon

Merge request reports