Ever since I installed emacs on a new machine I have seen an ugly behaviour. Unfortunately, my old .emacs files are rather fragmented and I can't determine whether I used to have elisp that took care of this.
The problem is this: it used to be that when I performed a command that would open a new buffer such as grep'ing, or clicking a file name within search results, one of two things would happen:
I want this behaviour back. What I am getting now is the following:
Emacs will keep splitting the window until four buffer windows are open. If I continually click multiple grep results, the buffer window where they open cycles through the three other (non-grep-results) buffer windows. I'd like it if they just kept opening in the same location: the "next" buffer window beside/below the results--same buffer window every time.
Any thoughts on how to achieve this behaviour?
Use the C-x b command or the Buffers menu. Or if you haven't opened the file, yet, use the C-x C-f command to open the new file in a new buffer. To unsplit the window, use the command C-x 1 or right-click on either title bar.
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.
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.
Consider setting split-height-threshold
to a larger value than the frame height; that will prevent unwanted vertical split.
(setq split-height-threshold 999)
If you prefer vertical split over horizontal split, customize split-width-threshold
instead.
For more fine-grained control of how a new buffer is displayed, customize display-buffer-function
; that will allow you to completely replace the default display-buffer
function which dictates the buffer display policy.
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