jcollard / elm-mode

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

elm-format-on-save stopped working, elm-format-on-save-mode works #154

Closed rofrol closed 5 years ago

rofrol commented 5 years ago

This worked for me:

(add-hook 'elm-mode-hook 'elm-format-on-save-mode)

Should we change this in doc:

Set or customize elm-format-on-save to t to apply elm-format

purcell commented 5 years ago

Hmm. The variable should still work (see https://github.com/jcollard/elm-mode/blob/25b36f0001867c2f55c4cfcd613c650ffa7ed238/elm-mode.el#L168) and it works for me locally. How do you have things set up?

The docstring for elm-format-on-save has been updated, though the README should also get updated, yes.

rofrol commented 5 years ago

This is my config https://github.com/rofrol/.emacs.d/blob/master/lisp/rofrol-elm.el

purcell commented 5 years ago

Ah, so you were previously setting elm-format-on-save in a function called via elm-mode-hooks. Yes, that wouldn't work now, sorry.

purcell commented 5 years ago

Right, I've updated the docs. Note that if you had written (setq elm-format-on-save t) at the top level, ie. not within a hook function, then things would have worked as expected.

rofrol commented 5 years ago

Fixed by https://github.com/jcollard/elm-mode/commit/28f95ba81066179e7baee71c7112745f4e31d2cd