Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect macro-expansion of evilified-state-evilify-maps with pre-bindings #16514

Closed
bcc32 opened this issue Aug 2, 2024 · 0 comments · Fixed by #16515
Closed

Incorrect macro-expansion of evilified-state-evilify-maps with pre-bindings #16514

bcc32 opened this issue Aug 2, 2024 · 0 comments · Fixed by #16515

Comments

@bcc32
Copy link
Contributor

bcc32 commented Aug 2, 2024

evilified-state-evilify-maps attempts to modify MAP during
macro-expansion rather than expanding to a form that does so. This
means that if macro-expansion occurs before MAP is bound (to a
keymap), it errors unexpectedly (even if :eval-after-load argument
is used or the whole form is wrapped in with-eval-after-load).

To demonstrate the bug, evaluating this snippet succeeds (and
returns nil):

(when nil
  (evilified-state-evilify-map bogus-map
    :eval-after-load bogus
    :bindings "a" nil))

whereas evaluating this snippet errors:

(when nil
  (evilified-state-evilify-map bogus-map
    :eval-after-load bogus
    :pre-bindings "a" nil))

and indeed, this errors too:

(macroexpand-1
 '(evilified-state-evilify-map bogus-map
    :eval-after-load bogus
    :pre-bindings "a" nil))

The latter two error with:

Debugger entered--Lisp error: (void-variable bogus-map)
bcc32 added a commit to bcc32/spacemacs that referenced this issue Aug 2, 2024
Pre-bindings should be set before evilification of the map, but not
during macro-expansion itself, as the macro may be expanded before the
map is defined.

Fix syl20bnr#16514.
bcc32 added a commit to janestreet/spacemacs that referenced this issue Aug 2, 2024
Pre-bindings should be set before evilification of the map, but not
during macro-expansion itself, as the macro may be expanded before the
map is defined.

Fix syl20bnr#16514.
bcc32 added a commit to janestreet/spacemacs that referenced this issue Aug 15, 2024
Pre-bindings should be set before evilification of the map, but not
during macro-expansion itself, as the macro may be expanded before the
map is defined.

Fix syl20bnr#16514.
bcc32 added a commit to janestreet/spacemacs that referenced this issue Aug 16, 2024
Pre-bindings should be set before evilification of the map, but not
during macro-expansion itself, as the macro may be expanded before the
map is defined.

Fix syl20bnr#16514.
bcc32 added a commit to janestreet/spacemacs that referenced this issue Aug 16, 2024
Pre-bindings should be set before evilification of the map, but not
during macro-expansion itself, as the macro may be expanded before the
map is defined.

Fix syl20bnr#16514.
bcc32 added a commit to janestreet/spacemacs that referenced this issue Aug 16, 2024
Pre-bindings should be set before evilification of the map, but not
during macro-expansion itself, as the macro may be expanded before the
map is defined.

Fix syl20bnr#16514.
bcc32 added a commit to janestreet/spacemacs that referenced this issue Sep 11, 2024
Pre-bindings should be set before evilification of the map, but not
during macro-expansion itself, as the macro may be expanded before the
map is defined.

Fix syl20bnr#16514.
bcc32 added a commit to janestreet/spacemacs that referenced this issue Sep 26, 2024
Pre-bindings should be set before evilification of the map, but not
during macro-expansion itself, as the macro may be expanded before the
map is defined.

Fix syl20bnr#16514.
bcc32 added a commit to janestreet/spacemacs that referenced this issue Sep 27, 2024
Pre-bindings should be set before evilification of the map, but not
during macro-expansion itself, as the macro may be expanded before the
map is defined.

Fix syl20bnr#16514.
bcc32 added a commit to janestreet/spacemacs that referenced this issue Sep 27, 2024
Pre-bindings should be set before evilification of the map, but not
during macro-expansion itself, as the macro may be expanded before the
map is defined.

Fix syl20bnr#16514.
bcc32 added a commit to janestreet/spacemacs that referenced this issue Sep 27, 2024
Pre-bindings should be set before evilification of the map, but not
during macro-expansion itself, as the macro may be expanded before the
map is defined.

Fix syl20bnr#16514.
bcc32 added a commit to janestreet/spacemacs that referenced this issue Sep 27, 2024
Pre-bindings should be set before evilification of the map, but not
during macro-expansion itself, as the macro may be expanded before the
map is defined.

Fix syl20bnr#16514.
bcc32 added a commit to janestreet/spacemacs that referenced this issue Sep 30, 2024
Pre-bindings should be set before evilification of the map, but not
during macro-expansion itself, as the macro may be expanded before the
map is defined.

Fix syl20bnr#16514.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant