Running Emacs in the same window as command line
How to make Emacs to be started by emacs
in the same window as command line? I can do it by typing emacs -nw
, but can I开发者_高级运维 put a line into .emacs
so that it would work automatically?
The short answer is "no".
By the time your .emacs is read, the choice whether to use a graphical or non-graphical display has been made.
Perhaps a shell alias would better suit your needs
alias emacs 'emacs -nw'
You can verify this by adding
(y-or-n-p "Sourcing .emacs...")
at the top of your .emacs and run both graphical and non-graphical variants of Emacs, either way you get prompted after the Emacs has come up (graphically or non-graphically).
The other thing to keep in mind is that most Linux distributions have a package which allows for the installation of emacs without graphical support. On Debian-based distros this is emacs-nox. Furthermore, since the development of emacs23 was completed, emacs now has a daemon mode so you can use emacsclient to connect to a single running instance of emacs. This might give you some flexibility if you desire the ability to use both graphical and non-graphical clients.
精彩评论