emacs byte compile incompability on 23.1 vs 23.2
Perm url with updates: http://xahlee.org/emacs/elisp_byte_compile_problem.html
Emacs byte compile incompability on 23.1 vs 23.2
Xah Lee, 2010-06-22
Stung by a emacs byte-compile problem. Cost: 2 hours.
Summary: if you are doing elisp dev on more than one machine, best to re-byte-compile the files on the machine if you run into some strange errors.
Byte compiled elisp files should work cross-platform for emacs 23.2. It has been working between my Windows Vista and Mac 10.4.x in the past year. Today, i just byte compiled the whole dir of elisp files on our ErgoEmacs source trunk, then synced over to my Mac as a regular routine, then started emacs on my Mac. I keep getting this strange error on my Mac:
Wrong number of arguments: called-interactively-p, 1
Very odd error. Starting emacs with “--debug-init” didn't help. Turning on toggle-debug-on-error while emacs is running didn't help much neither.
I thought some new change i made to ErgoEmacs recently caused the error. So, i started to bebug. Tried to comment out various packages, but it's elusive. One time commenting out loading package X seems to work, but another time no, but commenting out package Y worked.
First i thought the problem is the ErgoEmacs Keybinding minor mode. Then i'm sure it's YASnippet. But that's odd, because we haven't touched that package for many months. Then, i think it could be xbbcode-mode.
Very odd error. “Wrong number of arguments”. Thats pretty much the error you'll notice first when you write a new function. And “called-interactively-p”?? In the “*Messages*” buffer, i also saw something about a hook that caused this. Bah, there's lots hooks in ErgoEmacs. The ErgoEmacs keybinding has hooks, yasnippet adds hooks i think. Maybe the new version off PrettyControlL (pp-c-l) i just updated today caused the problem.
In short, took me 2 hours to eventually realize that it is the “.elc”. Byte compile the whole elisp dir of packages on the Mac made it work.
Emacs 23.2's release notes does not mention any byte-compile incompatible changes.
Not quite sure what's the problem exactly. The emacs on my Windows is Emacs 23.2.1, while on the Mac is 23.1.1.
Note: emacs 22 can't read emacs 23's byte compiled file if the file contains unicode chars, due to emacs 23's unicode change. See: New Features in Emacs 23.