ergoemacs / ergoemacs-mode

ergoemacs-mode
ergoemacs.github.io/
GNU General Public License v3.0
293 stars 35 forks source link

After a while, I get: "Symbol's value as variable is void: setup-hook" #299

Closed pdg137 closed 10 years ago

pdg137 commented 10 years ago

On melpa versions ergoemacs-mode-20140822.640 and ergoemacs-mode-20140825.1200, when I load ergoemacs-mode in a minimal way and run for a while, opening various files and running commands in a shell, eventually Emacs ends up in a state where almost every command (e.g. Ctrl+O, or Alt+A) fails with the message "Symbol's value as variable is void: setup-hook". This renders it unusable until a restart.

I am unsure about how to help debug this, but I can run whatever commands you need to reveal more debugging information. It usually happens after just about five minutes of editing, but I can't figure out a specific sequence that reliably causes the problem.

mattfidler commented 10 years ago

I hate these bugs since I usually have no clue about how to track them down.

However in this case there is some clue in the error message "Symbol's value as variable is void: setup-hook". This is probably because symbol-value is used. Therefore, I have changed every symbol-value lookup in ergoemacs-mode to ignore any errors. Let me know if it works for you.

pdg137 commented 10 years ago

I'm running on e7c66f24 and still experience the problem. I'll start a git-bisect and let you know which commit caused it.

mattfidler commented 10 years ago

Thanks Paul. On Aug 26, 2014 1:20 PM, "Paul Grayson" notifications@github.com wrote:

I'm running on e7c66f2 https://github.com/ergoemacs/ergoemacs-mode/commit/e7c66f24e2185333c4b11f9769076674aa0c9343 and still experience the problem. I'll start a git-bisect and let you know which commit caused it.

— Reply to this email directly or view it on GitHub https://github.com/ergoemacs/ergoemacs-mode/issues/299#issuecomment-53465595 .

mattfidler commented 10 years ago

Perhaps ergoemacs-mode is trying to advise setup-hook...? Regardless I think that I should only advise user hooks for modes.

pdg137 commented 10 years ago

I ran through a bisect (doing at least few minutes of editing before calling a commit "good") and found that 04b402f482d83c6b2c5774f7603b6461216b7e34 is the first bad commit. There is a lot of stuff in there about hooks, so it seems plausible that the problem could have been caused by that change.

mattfidler commented 10 years ago

Therefore commit 098e5b5 probably fixes the issue? setup-hook should never be advised since it doesn't match -mode-hook

Tarmil commented 10 years ago

With the latest version (fb5a2f8) I still get this issue.

Here is a stack trace I got when trying to do M-a customize-variable, if it's any help: https://gist.github.com/Tarmil/d14a766c7a4d3fb159c7

mattfidler commented 10 years ago

Thanks @Tarmil. It is quite useful. I haven't got the setup-hook error for awhile, so can no longer reproduce it. It seems it is happening with an anyonymous function. I have excluded anything with setup-hook in the anonymous function as well as only including anything that has define-key within it. Perhaps this will fix the bug...

pdg137 commented 10 years ago

That seems to fix it for me, too, so I will close the issue. Thanks!