Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I prevent Emacs from horizontally splitting the screen when opening multiple files?

Tags:

emacs

I want to be able to open multiple files with Emacs like the following command:

emacs file1 file2

and have the Emacs screen -not- be split horizontally when Emacs starts up. Opening the files in different buffers is what I expected, with just one of the files displayed in the entire Emacs window.

So how do I do this?

like image 934
user140321 Avatar asked Jul 17 '09 17:07

user140321


2 Answers

(add-hook 'window-setup-hook 'delete-other-windows)

works the way I want... just found that out after I asked here.

like image 66
user140321 Avatar answered Oct 04 '22 19:10

user140321


Well, you can set up an (tcsh) alias like so

alias emacs emacs -eval '"(run-with-idle-timer 0 nil (quote delete-other-windows))"'

This makes emacs hide all the other windows (so you only have one). So your invocation

emacs file1 file2

is translated to

emacs -eval '"(run-with-idle-timer 0 nil (quote delete-other-windows))"' file1 file2
like image 32
Trey Jackson Avatar answered Oct 04 '22 18:10

Trey Jackson