Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions haskell-indentation.el
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ positions are allowed."
(define-minor-mode haskell-indentation-mode
"Haskell indentation mode that deals with the layout rule.
It rebinds RET, DEL and BACKSPACE, so that indentations can be
set and deleted as if they were real tabs. It supports
`auto-fill-mode'.
set and deleted as if they were real tabs.

It is possible to render indent stops for current line as
overlays. Please read documentation for option
Expand All @@ -150,14 +149,13 @@ clashing with other modes."
:keymap haskell-indentation-mode-map
(kill-local-variable 'indent-line-function)
(kill-local-variable 'indent-region-function)
(kill-local-variable 'normal-auto-fill-function)

(when haskell-indentation-mode
(set (make-local-variable 'indent-line-function)
'haskell-indentation-indent-line)
(set (make-local-variable 'indent-region-function)
'haskell-indentation-indent-region)
(set (make-local-variable 'normal-auto-fill-function)
'haskell-indentation-auto-fill-function)

(when haskell-indentation-show-indentations
(haskell-indentation-enable-show-indentations))))

Expand Down Expand Up @@ -187,20 +185,6 @@ NIL otherwise."
;;----------------------------------------------------------------------------
;; UI starts here

(defun haskell-indentation-auto-fill-function ()
"" ; FIXME
(when (> (current-column) fill-column)
(while (> (current-column) fill-column)
(skip-syntax-backward "-")
(skip-syntax-backward "^-"))
(let ((indent (car (last (haskell-indentation-find-indentations-safe)))))
(delete-horizontal-space)
(newline)
(when (haskell-indentation-bird-p)
(insert ">"))
(indent-to indent)
(end-of-line))))

(defun haskell-indentation-reindent-to (col &optional move)
"Reindent current line to COL, move the point there if MOVE is non-NIL."
(let* ((ci (haskell-indentation-current-indentation)))
Expand Down
1 change: 1 addition & 0 deletions haskell-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ Minor modes that work well with `haskell-mode':
;; TABs stops are 8 chars apart, as mandated by the Haskell Report. --Stef
(set (make-local-variable 'indent-tabs-mode) nil)
(set (make-local-variable 'tab-width) 8)
(set (make-local-variable 'comment-auto-fill-only-comments) t)
;; Haskell is not generally suitable for electric indentation, since
;; there is no unambiguously correct indent level for any given line.
(when (boundp 'electric-indent-inhibit)
Expand Down