Regarding the comment: Nothing except something in your init.el can cause the effect you are having now (if you didn't start Emacs with additional command line arguments). So there must be something in your init.el that creates a new window.
Here is something I put together to (hopefully) find what causes the window splitting.
First, add an advice to split-window-right
. The lambda will be called before split-window-right
was called. The lambda will print out the backtrace frame
(advice-add 'split-window-right :before (lambda (&rest _) (print (backtrace-frames))))
Then to test it I defined a function that calls split-window-right
.
(defun some-function () (split-window-right))
Calling it prints this:
((t backtrace-frames nil nil)
(nil print
((backtrace-frames))
nil)
(t
(lambda
(&rest _)
(print
(backtrace-frames)))
nil nil)
(t apply
((lambda
(&rest _)
(print
(backtrace-frames)))
nil)
nil)
(t split-window-right nil nil)
(t some-function nil nil)
(t eval
((some-function)
nil)
nil)
(t elisp--eval-last-sexp
(t)
nil)
(t eval-last-sexp
(t)
nil)
(t eval-print-last-sexp
(nil)
nil)
(t funcall-interactively
(eval-print-last-sexp nil)
nil)
(t call-interactively
(eval-print-last-sexp nil nil)
nil)
(t command-execute
(eval-print-last-sexp)
nil))
You can find some-function
is right before split-window-right
.
This may solve your problem, may not. But I think it worth giving a try : )
emacs -Q
(no init file), and you will see that there is no split window. Consider how you are starting it otherwise (e.g. passing it arguments). Other than that, bisect your init file to find the culprit. If you need the effect ofC-x 1
at some point you can use(delete-other-windows)
but you shouldn't be bothering to create extra windows that you need to delete. You are the master of your init file. Emacs just does what you tell it to do, starting with your init file. – Drew Oct 13 '18 at 23:31(delete-other-windows)
into my init file, and it did not work, same split of the frame. Does it need to be placed in some particular order? How can I then prevent that initial redundant creation of windows I do not need? – Vass Oct 14 '18 at 3:27emacs -Q
? If not, then your init file is the problem. It doesn't matter whether you see any code affecting windows in it. Something you are doing in it invokes some code that does something affecting windows. Bisect your init file, recursively, till you locate the problem. We cannot guess what you are doing in your init file. It's your file - unless you see the same problem without it then you are causing the problem yourself, with your init file. – Drew Oct 14 '18 at 21:35