Nathaniel Flath
Nathaniel Flath

Reputation: 16045

'Symbol's function definition is void: nil' which symbol?

I'm getting the following error when starting emacs: (as shown from the messages buffer):

c-font-lock-fontify-region: Symbol's function definition is void: nil

How do I track down what exactly is causing the error in this function? debug-on-error is true, but it still doesn't give any more information here.

Upvotes: 2

Views: 3438

Answers (2)

Stefan
Stefan

Reputation: 28581

In order to get a backtrace even if the error is caught by a condition-case you can try to (setq debug-on-signal t). This will trigger in many cases which aren't bugs, so it's something to use only occasionally because it can really get in the way, but it might be helpful in this particular case.

Upvotes: 2

sds
sds

Reputation: 60062

The symbol is nil. It does not name a function.

Generally speaking, to debug the error, you need to set debug-on-error to t and look at the *Backtrace* buffer. If no *Backtrace* buffer appears (which is the case here), this means that the caller of the function which signals the error catches the error. You would need to chase the code looking for condition-case and disable it. Good luck with that :-(

Looking at the c-font-lock-fontify-region definition in progmodes/cc-mode.el, I see there

(funcall (default-value 'font-lock-fontify-region-function)
         new-beg new-end verbose)

which can easily cause the error if (default-value 'font-lock-fontify-region-function) is nil.

Upvotes: 6

Related Questions