emacs-evil / evil

The extensible vi layer for Emacs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I handle `Symbol’s function definition is void: evil-add-to-alist`?

huyz opened this issue · comments

commented

Issue type

  • Question

Environment

Emacs version: GNU Emacs 29.1 (build 1, aarch64-apple-darwin22.5.0, Carbon Version 169 AppKit 2299.6) of 2023-08-08

Operating System: macOS 13.5.1 (Ventura, ARM)
Evil version: 1.15.0
Evil installation type: MELPA
Graphical/Terminal: macOS GUI
Tested in a make emacs session (see CONTRIBUTING.md): No

Reproduction steps

  • Start Emacs
  • Run M-x load-library and evil

Expected behavior

Evil should load and I shouldn't see an error

Actual behavior

I get:

Loading evil...
byte-code: Symbol’s function definition is void: evil-add-to-alist

Further notes

I used to use evil last cloned from git in 2015. Now I just installed from elpa and this is what I get.

evil-add-to-alist was deprecated for many years and eventually removed in favor of alist-get/evil--add-to-alist. You should update any external code that depended on it. Could you produce a backtrace to show what is still using it?

commented

Here's the backtrace:

Debugger entered--Lisp error: (void-function evil-add-to-alist)
  evil-add-to-alist(evil-global-keymaps-alist evil-normal-state-minor-mode evil-normal-state-map)
  byte-code("\301\302N\204\f\0\303\301\302\304#\210\305\301!\210\303\301\306\307#\210\310\311\301\300#\210\310\312\301\10#\207" [evil-normal-state-map evil-normal-state-minor-mode variable-documentation put nil make-variable-buffer-local permanent-local t evil-add-to-alist evil-global-keymaps-alist evil-mode-map-alist] 4)
  require(evil-states)
  byte-code("\302\303!\210\302\304!\210\302\305!\210\302\306!\210\302\307!\210\302\310!\210\302\311!\210\302\312!\210\302\313!\210\302\314!\210\302\315!\210\302\316!\210\10\203..." [evil-want-integration evil-want-keybinding require evil-vars evil-common evil-core evil-states evil-repeat evil-macros evil-search evil-ex evil-types evil-commands evil-jumps evil-maps evil-integration evil-keybindings run-hooks evil-after-load-hook provide evil] 2)
  load("evil")
  load-library("evil")
  funcall-interactively(load-library "evil")
  call-interactively(load-library record nil)
  command-execute(load-library record)
  execute-extended-command(nil "load-library" "load-library")
  funcall-interactively(execute-extended-command nil "load-library" "load-library")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

Besides that, I tried:

❯ rg --smart-case -L --no-ignore --hidden --binary evil-add-to-alist
elpa/evil-20230828.1342/evil-search.elc: binary file matches (found "\0" byte around offset 5)

elpa/evil-20230828.1342/evil-states.elc: binary file matches (found "\0" byte around offset 5)

That's all I could find in my ~/.emacs.d.

I can't make sense of this. Thanks for your help

commented

Oh you know what? I just realized these compiled *.elc files were probably from when my packages were in a half-upgraded state. Deleting them fixed my problem.

Thanks!