Emacs package to immitate
narrow-to-region with more eye-candy.
narrow-to-region, which completely hides text outside the narrowed region, this package simply deemphasizes the text, makes it readonly, and makes it unreachable. This leads to a much more natural feeling, where the region stays static (instead of being brutally moved to a blank slate) and is clearly highlighted with respect to the rest of the buffer.
The easiest way is to install from Melpa.
M-x package-install fancy-narrow
You can also download this file, open it in emacs, and use
fancy-narrow-to-regionto see it in action. To widen the region again afterwards use
If you activate the minor mode (
fancy-narrow-mode), then the standard narrowing keys (
C-x n n,
C-x n w, etc) will make use of fancy-narrow.
To customise the face used to deemphasize unreachable text, customise
Note this is designed for user interaction. For using within lisp code, the standard
narrow-to-region is preferable, because the fancy version is susceptible to
inhibit-read-only and some corner cases.