jcollard / elm-mode

Elm mode for emacs
GNU General Public License v3.0
375 stars 67 forks source link

(void-variable elm) #56

Closed caisah closed 8 years ago

caisah commented 8 years ago

Every time after I update my packages with cask and there is a new version of elm-mode when I (require 'elm-mode) I get (void-variable elm). This is from my init:

`Debugger entered--Lisp error: (void-variable elm)

[nil "\302\303\304 BD\"\207" [elm elm-oracle--pattern ac-define-source (candidates elm-oracle--get-completions ac-prefix t) prefix] 5]()

eval-after-load(auto-complete #[nil "\302\303\304 BD\"\207" [elm elm-oracle--pattern ac-define-source (candidates elm-oracle--get-completions ac-prefix t) prefix] 5]) require(elm-interactive) byte-code("\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\207" [require elm-tags elm-format elm-indent elm-interactive elm-font-lock] 2) require(elm-mode) eval-buffer(#<buffer load-256167> nil "/home/caisah/.emacs.d/config/programming/elm-config.el" nil t) ; Reading at buffer position 93 load-with-code-conversion("/home/caisah/.emacs.d/config/programming/elm-config.el" "/home/caisah/.emacs.d/config/programming/elm-config.el" nil t) require(elm-config) eval-buffer(#<buffer load-429947> nil "/home/caisah/.emacs.d/config/general-settings.el" nil t) ; Reading at buffer position 2796 load-with-code-conversion("/home/caisah/.emacs.d/config/general-settings.el" "/home/caisah/.emacs.d/config/general-settings.el" nil t) require(general-settings) eval-buffer(#<buffer load> nil "/home/caisah/.emacs.d/init.el" nil t) ; Reading at buffer position 313 load-with-code-conversion("/home/caisah/.emacs.d/init.el" "/home/caisah/.emacs.d/init.el" t t) load("/home/caisah/.emacs.d/init" t t)

[0 "\205\262 \306=\203\307\310Q\202; \311=\204\307\312Q\202;\313\307\314\315#\203*\316\202;\313\307\314\317#\203:\320\nB\321\202;\316\322\323\322\211#\210 \322=\203a\324\325\326\307\327Q!\"\323\322\211#\210 \322=\203\210 \203\243\330 !\331\232\203\243\332 !\211\333P\334!\203}\211\202\210\334!\203\207\202\210\314\262\203\241\335 \"\203\237\336\337 #\210\340\341!\210\266\f?\205\260\314\323\342\322\211#)\262\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" (initialization "_emacs' init file is deprecated, please use `.emacs'") "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7 "\n\n(fn)"]()

command-line() normal-top-level()`

I have to delete the package and install it via package to get it working. Do you have any ideas why this may happen? Is it a problem with elm-mode or cask? How could I fix it? Thanks!

Bogdanp commented 8 years ago

I don't know enough about how cask works to give an informed opinion, but that error looks similar to what is described here. i.e. for some reason the ac-define-source call gets byte compiled and the interpreter then assumes it's a function (even though it's a macro) which leads it to evaluate its first argument, elm, when you load auto-complete; obviously there is no elm variable so that leads to that error. My recommendation would be to ensure you byte-compile auto-complete before elm-mode.

caisah commented 8 years ago

Thanks for the reply, I'll look forward into it.

Bogdanp commented 8 years ago

It looks like you weren't the only one experiencing the problem: https://github.com/syl20bnr/spacemacs/issues/4682 . I'm re-opening this issue until I get a fix in.

Bogdanp commented 8 years ago

Alright, this problem should no longer happen.