One library that provides such behavior is Narrow Indirect (narrow-indirect.el
). It gives you a different view of a portion of the buffer, or even of the whole buffer (use C-x h C-x 4 n n
).
It always has the same text and text properties, but otherwise it is pretty independent. In particular, you can kill an indirect buffer without affecting its base buffer. You will likely want to kill indirect narrowed buffers rather than widening them.
You can use indirect buffers for more than you might think. You can use clones taken from portions of Dired buffers, for example, to give you useful (active) views into a directory listing. There are only a few keys/commands (such as g
to update the listing) that do not work, because they depend on a view of the whole Dired buffer. Experiment, and you will no doubt find interesting new uses for indirect buffers.
See also the Emacs manual, node Indirect Buffers
.