Emacs: Narrow to Region

By Xah Lee. Date: .

Narrow to Region is a feature in emacs that lets you restrict editing to just a region of the current buffer. (as if the whole buffer is just that region)

Alt+x narrow-to-region
Restrict editing in this buffer to the current region.
Alt+x widen
remove the effect of narrow-to-region.

💡 TIP: Narrow to Region is useful for example when you want to do a lot find and replace, but only to a specific region. [see Emacs: Find Replace in Current File]