0

Sometimes when I save a file I get a debugger error message in Emacs, it doesn't happen always but happens randomly whenever I save a file. The error message is as follows

Debugger entered--Lisp error: (void-variable w)
  eval(w t)
  eval-expression(w nil nil 127)
  funcall-interactively(eval-expression w nil nil 127)
  #<subr call-interactively>(eval-expression nil nil)
  apply(#<subr call-interactively> eval-expression (nil nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> eval-expression nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (eval-expression nil nil))
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

This happens whenever I save a file by pressing ":" to invoke the evil mode vim command and following it with "w" for saving the file. Also is there any way of turning off this popup? Even if I cannot find the bug is it possible to disable this pop-up debugger error so it never shows up?

shynur
  • 334
  • 10
Zer0day
  • 89
  • 5

1 Answers1

0

Sounds like you're maybe hitting a key similar to : and getting command eval-expression, which tries to evaluate something you type next (such as w then RET).

I can't speak for Evil's key bindings, but in vanilla Emacs M-:, not :, is bound in fact to eval-expression. (M- is Alt.)

So if you type M-: w RET instead of : w RET then that might explain what you see: Emacs tries to evaluate the w as a variable, and it's not bound to any value as a variable.

Drew
  • 29,895
  • 7
  • 74
  • 104
  • Sorry for the late reply, I do not think I hit "M-: w Ret", I tried to get the same bug today as well but I never pressed the Alt key. Is there any way I can disable the debug-lisp error window to pup up? Or completely disable it? – Zer0day Aug 23 '23 at 12:49
  • You may have hit some other key that Evil binds to `eval-expression`. That's why I said that `M-:` is a *vanilla* Emacs key for that command - dunno what keys Evil uses. You can set variable `debug-on-error` to `nil` to prevent entering a backtrace (but really that should be posted as a separate question). – Drew Aug 23 '23 at 14:39