Skip to content

Commit 5aeff2d

Browse files
committed
Merge pull request #1264 from gracjan/pr-indent-region-noop
Document indent-region as a no-op
2 parents bcdd8d4 + 650c112 commit 5aeff2d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/haskell-mode.texi

+20
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,26 @@ selection mode (without redefining @kbd{C-x},@kbd{C-c},@kbd{C-v}, and
511511
@kbd{C-z}) by calling @kbd{M-x cua-selection-mode} (or adding
512512
@code{(cua-selection-mode nil)} to your @code{haskell-mode-hook}).
513513

514+
@section Region indent is a no-op
515+
516+
There is a @code{indent-region} function that supposedly could be used
517+
to indent code region without changing its semantics. Sadly it does not
518+
work that way because usual use case for @code{indent-region} is:
519+
520+
@enumerate
521+
@item
522+
Alter first line of code in region.
523+
@item
524+
Call @code{indent-region} to fix indentation for remaining lines.
525+
@end enumerate
526+
527+
Note that between 1 and 2 program is already semantically broken and
528+
knowing how to indent it preserving semantic from before step 1 would
529+
require time travel.
530+
531+
To stay on the safe side @code{indent-region-function} is bound to a
532+
no-op in @code{haskell-mode}.
533+
514534
@node External indentation
515535
@chapter Other ways to indent code
516536

0 commit comments

Comments
 (0)