How can I open files only in a specific window in Emacs?

I configured emacs as follows, and I would like to open and use the source files only in the first window (* scratch *).

But sr-speedbar likes to open a new file in the last window (for example, in the * shell * window that opens).

How can I stop it when opening files in some unwanted windows?

enter image description here

+6
source share
1 answer

I ran into this problem. My solution, which I can personally recommend, is to use the purpose package.

It allows you to select specific windows for specific "goals", each of which has user-configurable modes; for example, edit may have prog-mode associated with it, for the purpose of view may be an information mode associated with it, etc. At any time when a new buffer should be opened, if there is currently a window dedicated to this goal, Emacs will force the buffer to be open in this highlighted window.

As an example, my default Emacs workspace consists of one large edit window, one comm window for IRC and two admin windows for RSS and another for email.

Highly recommend.

+1
source

Source: https://habr.com/ru/post/986117/


All Articles