Skip to content

Commit dc9acc2

Browse files
committed
Merge pull request #945 from gracjan/pr-remove-auto-fill-from-indentation
Remove auto-fill code from indentation
2 parents c77c594 + 4d06cd5 commit dc9acc2

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

haskell-indentation.el

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ positions are allowed."
138138
(define-minor-mode haskell-indentation-mode
139139
"Haskell indentation mode that deals with the layout rule.
140140
It rebinds RET, DEL and BACKSPACE, so that indentations can be
141-
set and deleted as if they were real tabs. It supports
142-
`auto-fill-mode'.
141+
set and deleted as if they were real tabs.
143142
144143
It is possible to render indent stops for current line as
145144
overlays. Please read documentation for option
@@ -150,14 +149,13 @@ clashing with other modes."
150149
:keymap haskell-indentation-mode-map
151150
(kill-local-variable 'indent-line-function)
152151
(kill-local-variable 'indent-region-function)
153-
(kill-local-variable 'normal-auto-fill-function)
152+
154153
(when haskell-indentation-mode
155154
(set (make-local-variable 'indent-line-function)
156155
'haskell-indentation-indent-line)
157156
(set (make-local-variable 'indent-region-function)
158157
'haskell-indentation-indent-region)
159-
(set (make-local-variable 'normal-auto-fill-function)
160-
'haskell-indentation-auto-fill-function)
158+
161159
(when haskell-indentation-show-indentations
162160
(haskell-indentation-enable-show-indentations))))
163161

@@ -187,20 +185,6 @@ NIL otherwise."
187185
;;----------------------------------------------------------------------------
188186
;; UI starts here
189187

190-
(defun haskell-indentation-auto-fill-function ()
191-
"" ; FIXME
192-
(when (> (current-column) fill-column)
193-
(while (> (current-column) fill-column)
194-
(skip-syntax-backward "-")
195-
(skip-syntax-backward "^-"))
196-
(let ((indent (car (last (haskell-indentation-find-indentations-safe)))))
197-
(delete-horizontal-space)
198-
(newline)
199-
(when (haskell-indentation-bird-p)
200-
(insert ">"))
201-
(indent-to indent)
202-
(end-of-line))))
203-
204188
(defun haskell-indentation-reindent-to (col &optional move)
205189
"Reindent current line to COL, move the point there if MOVE is non-NIL."
206190
(let* ((ci (haskell-indentation-current-indentation)))

haskell-mode.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ Minor modes that work well with `haskell-mode':
678678
;; TABs stops are 8 chars apart, as mandated by the Haskell Report. --Stef
679679
(set (make-local-variable 'indent-tabs-mode) nil)
680680
(set (make-local-variable 'tab-width) 8)
681+
(set (make-local-variable 'comment-auto-fill-only-comments) t)
681682
;; Haskell is not generally suitable for electric indentation, since
682683
;; there is no unambiguously correct indent level for any given line.
683684
(when (boundp 'electric-indent-inhibit)

0 commit comments

Comments
 (0)