jcollard / elm-mode

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

letrec in aquamacs #2

Closed cognominal closed 10 years ago

cognominal commented 10 years ago

Thx for elm-mode

I am using aquamacs and I type C-c C-l to get the interactive elm-repl buffer, it complains about the missing symbol letrec. What should I do to get a correct definition of this symbol?

Relevant message : Symbol's function definition is void: letrec

Aquamacs version: GNU Emacs 23.4.1 (x86_64-apple-darwin12.3.0, NS apple-appkit-1187.37) of 2013-06-14 on acs-trailblazer.ist.psu.edu - Aquamacs Distribution 2.5

Relevant Messages extract Loading /Users/cog/git/elm-mode/elm-map.el (source)...done Invalid face reference: quote [115 times] run-elm-repl: Symbol's function definition is void: letrecInvalid face reference: quote Invalid face reference: quote [160 times]

jcollard commented 10 years ago

I didn't realize that letrec was only available in emacs24. I am working to rewrite the relevant code.

jcollard commented 10 years ago

This should be resolved.

cognominal commented 10 years ago

Thx for the quick fix. Now aquamacs whines :

Warning: Bug in elm-mode: it forgets to call `run-mode-hooks' let: Symbol's function definition is void: window-total-width Loading /Users/cog/git/elm-mode/elm-util.el (source)...done

Everthing works fine in regular emacs btw. Have you a twitter handle btw?

jcollard commented 10 years ago

I will see if I can figure out if there is a way to get this to work in aquamacs. Unfortunately, I don't use mac so I can't really test it out.

Just to verify, you get this error when elm-mode loads? Or just when you try to load elm-repl in aquamacs?

Also, I don't really use twitter: https://twitter.com/jcbbjjttt

cognominal commented 10 years ago

I get it when I do ^C ^L which probably loads elm-mode.el which itself depends on elm-util.el because of the (require 'elm-util) at https://github.com/jcollard/elm-mode/blob/master/elm-repl.el#L17

It blows up in this function https://github.com/jcollard/elm-mode/blob/master/elm-util.el#L28

Anyway, no hurry, I can use the regular emacs instead of aquamacs

jcollard commented 10 years ago

What happens if you replace that function with this:

(defun intelligent-split-window ()
  (split-window))
cognominal commented 10 years ago

With your change, it splits the window correctly.

But it does not find elm-repl. Apparently tweaking (setenv "PATH" ....) is not the proper way to do it. I need to RTFM. Is this a comint thing?

cognominal commented 10 years ago

I did a symlink so that elm-repl is found from /usr/local/bin

jcollard commented 10 years ago

I pushed a change that should automatically call split-window if window-total-width can't be found.

As for loading elm / elm-repl, it needs to be in your emacs path. Your shell path will be inherited if you launch from the shell. However, this is not the case if you launch it in another way.

I added the following to my .emacs configuration and it works for me.

(setenv "PATH" (concat (getenv "PATH") ":~/.cabal/bin"))
(setq exec-path (append exec-path '("~/.cabal/bin")))