Skip to content

Commit 1f70244

Browse files
committed
Merge pull request #1193 from gracjan/pr-indent-region-do-nothing
Make haskell-indent-region do nothing
2 parents ad06a79 + 9e81a0b commit 1f70244

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

haskell-indentation.el

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,17 @@ indentation points to the right, we switch going to the left."
296296
(t nil)))
297297

298298
(defun haskell-indentation-indent-region (start end)
299-
"Indent region from START to END."
300-
(setq haskell-indentation-dyn-last-direction 'region)
301-
(haskell-indentation-indent-rigidly start end 1)
302-
(message "Press TAB or S-TAB again to indent the region more"))
299+
"This function does nothing.
300+
301+
It is better to do nothing to indent region in Haskell than to
302+
break the semantics of indentation. This function is used for
303+
`indent-region-function' because the default is to call
304+
`indent-line-function' on every line from START to END and that
305+
also produces catastrophic results.
306+
307+
Someday we will have indent region that preserves semantics and
308+
fixes up only indentation."
309+
nil)
303310

304311
(defun haskell-indentation-indent-backwards ()
305312
"Indent the current line to the previous indentation point."

0 commit comments

Comments
 (0)