Emacs package to immitate narrow-to-region with more eye-candy
Emacs Lisp
Permalink
Failed to load latest commit information.
LICENSE Initial commit Mar 17, 2014
README.md Agressive adivising Mar 29, 2014
fancy-narrow.el [Fix #14] Use with-silent-modifications Jan 24, 2016
narrowed-google-this.png screenshot Mar 27, 2014

README.md

fancy-narrow Donate

Emacs package to immitate narrow-to-region with more eye-candy.

Narrowed google-this

Unlike 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.

Installation

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 M-x package-install-from-buffer.

Usage

  1. Simply call fancy-narrow-to-region to see it in action. To widen the region again afterwards use fancy-widen.

  2. 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.

Customization

To customise the face used to deemphasize unreachable text, customise fancy-narrow-blocked-face.

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.