Recently, I often encounter errors like this:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)

I found that in some situations, the error is caused by expressions like this:

(= nil 4)    

I'm not sure whether this expression is intended to write like this, but it will work only if I change it to:

(eq nil 4)

However, (1) I need to replace all = to eq in that emacs lisp script (2) I'm not sure the codes should be modified like this.

I was wondering that whether I can write a few lines in the config file (.emacs) instead of modify on the source code to get things done. Does anyone have ideas about this?

有帮助吗?

解决方案

Don't do this.

You're going down the path of hiding errors in code. Figure out the root cause of why you're passing nil to = and fix that.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top