narrow-to-region

narrow-to-region is an interactive built-in function in `C source code'.

It is bound to C-x n n.

(narrow-to-region START END)

Restrict editing in this buffer to the current region.
The rest of the text becomes temporarily invisible and untouchable
but is not deleted; if you save the buffer in a file, the invisible
text is included in the file. C-x n w makes all visible again.
See also `save-restriction'.

When calling from a program, pass two arguments; positions (integers
or markers) bounding the text that should remain visible.