emacscollective / auto-compile

Automatically compile Emacs Lisp libraries
GNU General Public License v3.0
172 stars 16 forks source link

Problem auto-compiling on Windows #2

Closed daviesian closed 11 years ago

daviesian commented 11 years ago

Using auto-compile with the latest emacs-live on Windows, I get the following error pop up every time emacs starts:

Compiling file c:/Program Files (x86)/emacs-24.1/lisp/server.el at Fri Nov 30 23:07:44 2012 Entering directory c:/Program Files (x86)/emacs-24.1/lisp/' server.el:482:1:Warning: Unused lexical variablesafe' server.el:16:13:Error: End of file during parsing: c:/Users/Ian/AppData/Roaming/.emacs.d/packs/live/git-pack/lib/magit/magit.el

I'm not sure whether this is being caused by emacs-live or auto-compile. Any idea what's going on?

@samaaron may be able to provide more insight into the emacs-live side of things. Let me know if there's anything you'd like me to try to help narrow down the issue.

Cheers, Ian

tarsius commented 11 years ago

End of file during parsing: c:/Users/Ian/AppData/Roaming/.emacs.d/packs/live/git-pack/lib/magit/magit.el

This sounds like there is an unbalanced expression in magit.el. Most likely you accidentally modified the file and then didn't pay attention when asked whether you want to save it.

Since magit.el is the file that fails to load you cannot use magit to inspect modifications to itself. Instead goto the repository in a shell and inspect and then possibly undo the modifications.

git diff
git reset --hard HEAD

Alternatively start Emacs with no local init files (emacs -Q), open magit.el and run M-x check-parens and M-x byte-compile-file and then manually fix the problem (effectively reverting the modifications).

I think this is neither auto-compile's nor emacs-live's fault but feel free to ask again if you cannot fix the problem like describe above.

daviesian commented 11 years ago

Thanks very much for the suggestions.

magit.el has not been modified, and M-x check-parens reports no problems. The file loads, I can use the features it defines, and M-x byte-compile-file works with no problems. In fact, once I have manually run M-x byte-compile-file on magit.el, the error no longer pops up on startup. That makes me suspect that it's an auto-compile issue.

This is all with no local init files beyond the ones provided by emacs-live.

I'd appreciate any thoughts you have as to what's going on. As before, I'm happy to try things out if it helps you narrow down the problem.

Cheers, Ian

tarsius commented 11 years ago

magit.el has not been modified, and M-x check-parens reports no problems. The file loads, I can use the features it defines, and M-x byte-compile-file works with no problems. In fact, once I have manually run M-x byte-compile-file on magit.el, the error no longer pops up on startup. That makes me suspect that it's an auto-compile issue.

Yes, now it sounds like auto-compile could be at fault.

Could you please change the modification time of magit.el but not magit.elc while Emacs is not running. The next time Emacs starts auto-compile-on-load-mode' should cause it to be recompiled. Use emacs --debug-init`.

If you get the same error again edit and save magit.el in Emacs to see whether that causes a similar error or not.

This is all with no local init files beyond the ones provided by emacs-live.

Just because it wasn't written by you that is still some kind an "init file", isn't it :-) Definitily not vanilla Emacs.

So if you can reproduce the error with emacs-live please also try with an init file that only contains:

;; -*- no-byte-compile: t -*-
(add-to-list 'load-path "/path/to/auto-compile")
(require 'auto-compile)
(auto-compile-on-load-mode 1)
(auto-compile-on-save-mode 1)
(add-to-list 'load-path "/path/to/magit")
(require 'magit)
daviesian commented 11 years ago

Interestingly, this issue (whatever it was) seems to have vanished with emacs 24.2, the above was all using 24.1. Feel free to close.

@samaaron : You might want to revert the changes made in https://github.com/overtone/emacs-live/commit/dbb76b8c60b6b78d37bfaac0631d17e81ce17e64

samaaron commented 11 years ago

https://github.com/overtone/emacs-live/commit/83f7aba8fc299546a3c078a6608ac1d66f993728