I have configured my emacs as follows, and I would like to open and operate the source files only in the first window(*scratch*).
But the sr-speedbar loves to open the new file in the lastest window(e.g. the newly open *shell* window).
How can I stop it from opening files in some unwanted windows?
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.
Splitting WindowsThe command C-x 2 ( split-window-vertically ) breaks the selected window into two windows, one above the other. Both windows start out displaying the same buffer, with the same value of point.
You can have several buffers open at once, but can edit only one at a time. Several buffers can be visible at the same time when you're splitting your window.
Use Ctrl-x f to open a file from within Emacs. Create a new file in the same way as opening a file by specifying the new filename.
I've run into this problem as well. My solution, which I can personally recommend, is to use the purpose package.
It allows you to dedicate specific windows to specific "purposes" which each have user-configurable associated modes; for instance, the edit
purpose might have prog-mode
associated with it, the view
purpose might have `info-mode associated with it, etc. Any time a new buffer is to be opened, if there is a window currently dedicated to that purpose, Emacs will force said buffer to be opened in that dedicated window.
As an example, my default Emacs "workspace" consists of one large edit
window, one comm
window for IRC, and two admin
windows -- one for RSS and another for email.
Highly recommend.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With