Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
开发者_JS百科 Improve this questionHi I use emacs as my default editor. I would like emacs to run a process in the background from the shell without typing the&
at the end
How do I customize that?
gaurish108 ~: emacs hello.cpp &
[1] 3889
gaurish108 ~:
As Burton Samograd said, this is part of the shell syntax. If you want to hide it, try saving this in something like emacs.sh
emacs "$@" &
Then, chmod +x emacs.sh
, and as long as emacs.sh
is in a directory on your PATH, you should be able to run emacs as
emacs.sh filename
I always do
emacs --daemon
which actually using a very cool emacs feature where emacs runs as a server.
You then connect via
emacsclient -nw ## text mode, say via ssh on text connect
or
emacsclient -c & ## new x11 windows, return to prompt
and the best part is that the actual buffers remain active in the background emacs server while the front-end clients can go up or down --- stateful editing, and particular for modes with sessions (shell, SQL, R, ...) it makes a huge difference.
That irritating & is how you run a process in the background from the shell. This is so you get your command prompt back after you run a program. There is no way around it, it's just shell syntax.
精彩评论