Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] Disable indentation #1537

Closed
canonic-epicure opened this issue Aug 20, 2017 · 4 comments
Closed

[Discussion] Disable indentation #1537

canonic-epicure opened this issue Aug 20, 2017 · 4 comments

Comments

@canonic-epicure
Copy link

Hello,

I'm complete emacs newbie, seeking for the help from community.

How I can disable the smart haskell indentation? I want the "TAB" just inserting 4 spaces, nothing else and "shift+TAB" moving the line 4 spaces to the left, if possible, nothing else.

The solution from #90

(add-hook 'haskell-mode-hook (lambda ()
            (make-local-variable 'tab-stop-list)
            (setq tab-stop-list (number-sequence 4 80 4))
            (setq indent-line-function 'indent-relative)
            (haskell-indentation-mode 0)))

does not work (I've put it into the ~/.spacemacs before the custom-set-variables thing)..

I've also tried running "haskell-indentation-mode" command, which shows "haskell-indentation-mode disabled" but indentation is still fancy.

@gracjan
Copy link
Contributor

gracjan commented Aug 20, 2017

I see you really do not like indentation as it works now. May I know the snipped of code that it failed to indent the way you would like?

Calling (haskell-indentation-mode 0) should disable indentation and it is a bug if it does not do it.

@canonic-epicure
Copy link
Author

Where do I put this line? Or is it just a command to execute? If so, how do I provide the "0" argument?

I'm using spacemacs, pressing "alt + x" shows a long list of all available commands, then I'm typing "haskell-indentat" to narrow the list and then I can just hit enter to execute it. I can't supply the 0 argument - it is assumed to be the part of the command name.

When I just execute the command, I see "haskell-indentation-mode disabled" in the "minibuffer", but indentation is still controlled by something else.

@canonic-epicure
Copy link
Author

I'd really like to just have a "normal", "dumb" indentation behavior with 4 spaces, available in any text editor. I've added:

(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq indent-line-function 'insert-tab)

to my ~/.spacemacs, w/o any effect (still uses 8 spaces after disabling haskell-indenation-mode)...

@canonic-epicure
Copy link
Author

This seems helped:

(defun my-tabs-setup ()   
    (setq tab-width 4)   
    (setq indent-tabs-mode nil)   
    (setq indent-for-tab-command 'insert-tab) 
)

(add-hook 'haskel-mode-hook 'my-tabs-setup)

Now I just need to configure shift+tab to do the standard action, and I foresee the indentation of selection will be a separate epic configuration saga in 5 tomes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants