Difference between revisions of "Emacs/Formatting"

From HaskellWiki
Jump to navigation Jump to search
(→‎On Save: Rewording on save.)
Line 7: Line 7:
 
== On Save ==
 
== On Save ==
   
To use it on your Emacs before every save, you first need <code>haskell-mode-save-buffer</code>. It is recommended to rebind <code>C-x C-s</code> in haskell-mode to this. Add the following in your <code>haskell-mode-hook</code>.
+
To call it for every save, you first need <code>haskell-mode-save-buffer</code>. It is recommended to rebind <code>C-x C-s</code> in haskell-mode to this. Add the following in your <code>haskell-mode-hook</code>.
   
 
(define-key haskell-mode-map (kbd "C-x C-s") 'haskell-mode-save-buffer)
 
(define-key haskell-mode-map (kbd "C-x C-s") 'haskell-mode-save-buffer)

Revision as of 18:25, 28 May 2012


Stylish Haskell

Use M-x haskell-mode-stylish-buffer to call stylish-haskell on the current buffer.

On Save

To call it for every save, you first need haskell-mode-save-buffer. It is recommended to rebind C-x C-s in haskell-mode to this. Add the following in your haskell-mode-hook.

(define-key haskell-mode-map (kbd "C-x C-s") 'haskell-mode-save-buffer)

To enable Stylish Haskell, pop the following somewhere in your Emacs configuration:

(setq haskell-stylish-on-save t)

Or in your custom set variables:

(custom-set-variables '(haskell-stylish-on-save t))

Or you can M-x customize-group haskell and pretend none of this exists!