This produce not expected result because map and map-orig remain in the original form.
This is an evil use of eval.
I guess Vegard had chosen it because "map variable" doesn't exist in the evaluation of this form,
without appropriate eval-after-load. I'm not positive that though. Because:
This contradicts minimal suprising principal.
I beleave that users should write appropriate require or eval-after-load themselves. Emacs Lisp compiler warns when undefined variables are used.
If user wants to use autoload, he should write (eval-when-compile (require ...)) to make quiet compiler, and this solves the problem above.
Hence, I'd like you to fix this macro or evil-define-key.
Note:
You shouldn't generate intrinstic variables in macros. Macros should do only convert code.
Originally reported by: Ken Okada (Bitbucket: kenoss, GitHub: kenoss)
IMHO, using
eval
for forms in macros is definitely bad idea. It is used inevil-define-keys
.For example, see following configration and what happens.
This produce not expected result because
map
andmap-orig
remain in the original form. This is an evil use of eval.I guess Vegard had chosen it because "map variable" doesn't exist in the evaluation of this form, without appropriate
eval-after-load
. I'm not positive that though. Because:require
oreval-after-load
themselves. Emacs Lisp compiler warns when undefined variables are used. If user wants to use autoload, he should write(eval-when-compile (require ...))
to make quiet compiler, and this solves the problem above.Hence, I'd like you to fix this macro or
evil-define-key
.Note: