You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Emacs version: GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8)
Operating System: Arch Linux
Evil version: Evil version 1.15.0
Evil installation type: MELPA
Graphical/Terminal: Wayland/Terminal
Tested in a make emacs session (see CONTRIBUTING.md): No
Reproduction steps
Set variable evil-want-Y-yank-to-eol with use-package
This seems to be a bug caused by the initializers stored in evil-pending-custom-initialize.
For example, the custom variable evil-want-Y-yank-to-eol has a initializer evil-custom-initialize-pending-reset which adds a initialization form to the list evil-pending-custom-initialize.
We can see that custom-theme-set-variables is invoked before require. Then our customized value is inevitably overwritten.
Same thing applies to variables
evil-search-module
evil-visual-newline-commands
evil-motions
evil-intercept-maps
evil-overriding-maps
evil-disable-insert-state-bindings
evil-want-Y-yank-to-eol
However, a strange thing is, if these variable are set with setq in either :init or :config block of use-package, they work perfectly fine. I think this might because of the setter of these custom variables, which uses set-default. I don't know too much about this mechanism.
Final thought
evil-pending-custom-initialize was added 11 years ago. b26b286
This piece of code seems stale and not update-to-date with current use cases. I can see a lot custom variables now in Evil do not use this initialization idiom.
Do we still need it?
The text was updated successfully, but these errors were encountered:
Issue type
Environment
Emacs version: GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8)
Operating System: Arch Linux
Evil version: Evil version 1.15.0
Evil installation type: MELPA
Graphical/Terminal: Wayland/Terminal
Tested in a
make emacs
session (see CONTRIBUTING.md): NoReproduction steps
evil-want-Y-yank-to-eol
withuse-package
Expected behavior
The value of
evil-want-Y-yank-to-eol
ist
.Actual behavior
The value of
evil-want-Y-yank-to-eol
isnil
.Further notes
This seems to be a bug caused by the initializers stored in
evil-pending-custom-initialize
.For example, the custom variable
evil-want-Y-yank-to-eol
has a initializerevil-custom-initialize-pending-reset
which adds a initialization form to the listevil-pending-custom-initialize
.evil/evil-vars.el
Lines 623 to 628 in d28206c
That list is iterated by
evil-run-pending-custom-initialize
.evil/evil-vars.el
Lines 68 to 74 in d28206c
That function is called by hook
evil-after-load-hook
whenever packageevil
is required.evil/evil.el
Line 154 in d28206c
If we expand a
use-package
formThen we have
We can see that
custom-theme-set-variables
is invoked beforerequire
. Then our customized value is inevitably overwritten.Same thing applies to variables
evil-search-module
evil-visual-newline-commands
evil-motions
evil-intercept-maps
evil-overriding-maps
evil-disable-insert-state-bindings
evil-want-Y-yank-to-eol
However, a strange thing is, if these variable are set with
setq
in either:init
or:config
block ofuse-package
, they work perfectly fine. I think this might because of the setter of these custom variables, which usesset-default
. I don't know too much about this mechanism.Final thought
evil-pending-custom-initialize
was added 11 years ago.b26b286
This piece of code seems stale and not update-to-date with current use cases. I can see a lot custom variables now in Evil do not use this initialization idiom.
Do we still need it?
The text was updated successfully, but these errors were encountered: