jcollard / elm-mode

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

Tabs cannot be turned off suddenly #185

Closed mlp1802 closed 2 years ago

mlp1802 commented 2 years ago

I updated all packages (and elm mode was updated too, I could see) this morning and after that, whenever I use "tab" to indent, an actual tab is produced (instead of spaces). Since Elm doesn't tolerate tabs that's a problem I put (setq-default indent-tabs-mode nil) in the config file but that doesn't do anything. Can indent with spaces but takes way too long.

mlp1802 commented 2 years ago

This fixed it

(defun disable-tabs ()
    (interactive)
    (setq indent-tabs-mode nil))

(add-hook 'elm-mode-hook 'disable-tabs)
(add-hook 'prog-mode-hook 'disable-tabs)
purcell commented 2 years ago

Thanks @mlp1802, I had committed a change in https://github.com/jcollard/elm-mode/commit/02eb8dea838fa8fc22915fb7c7d0ed8ff2af634a to disable tabs, but I think that setting it to -1 instead of nil was mistaken. In any case, master is now fixed, so you can drop your local patch.