Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: same buffer, two windows, one narrowed, one not

I find the narrow-to-region command useful, however it applies to the buffer and not to the current window.

I'd like to have one window display a narrowed version of the buffer, while the buffer is displayed widened if it occurs in any other window.

Is this possible?

like image 886
EoghanM Avatar asked Mar 05 '10 14:03

EoghanM


People also ask

Can you only have one buffer open in Emacs at a time?

Each Emacs window displays one Emacs buffer at any time. A single buffer may appear in more than one window; if it does, any changes in its text are displayed in all the windows where it appears.

How do I open a second window in Emacs?

To open a new frame, select Make New Frame from the Files menu or press C-x 5 2 (for make-frame). Emacs makes a new frame containing the current buffer and puts it on top of the current frame.

How do I switch between buffers in Emacs?

To move between the buffers, type C-x b. Emacs shows you a default buffer name. Press Enter if that's the buffer you want, or type the first few characters of the correct buffer name and press Tab. Emacs fills in the rest of the name.

How do I open multiple files in Emacs?

Much better to use the multiple buffer feature of emacs. If you are editing the first file and want to start editing the second file, simply use the hot key C-x C-f or the menu selection File->Open File to start the second file. The second file is loaded into its own buffer.


1 Answers

Try M-x clone-indirect-buffer or C-x 4 c. For details, see Indirect Buffers.

like image 95
huaiyuan Avatar answered Oct 24 '22 06:10

huaiyuan