As title self-explains, I would like to show multiple regions in different places.
narrow-to-region
could be a possible solution, but as documentation indicated, only one region from begin to end could be narrowed. Any thoughts?
As title self-explains, I would like to show multiple regions in different places.
narrow-to-region
could be a possible solution, but as documentation indicated, only one region from begin to end could be narrowed. Any thoughts?
You can hide multiple regions, or you can have separate indirect buffers for them (one per narrowing).
If you want to hide multiple regions, e.g. make them invisible, you can use libraries zones.el
(code)and isearch-prop.el
(code).
A set of zones is a set of regions, i.e., multiple regions.
You can make a set of zones or its complement (the set of anti-zones) invisible, so that you do not see it at all, including while searching.
The commands for this are isearchp-make-zones-invisible
, isearchp-make-anti-zones-invisible
, isearchp-toggle-zones-invisible
, isearchp-toggle-anti-zones-invisible
, and isearchp-toggle-zone/anti-zone-visibility
.
(You can do many more things with a set of zones, besides showing/hiding it or its complement.)
If you want to have multiple different buffers, each corresponding to a different narrowing of some base buffer, then library narrow-indirect.el
(code) can help.
It lets you create an indirect buffer that's a clone of the current buffer and that is narrowed to a particular portion of it.
Such an indirect buffer 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.
See the Emacs manual, node Indirect Buffers.