开发者

emacs process in background without `&` [closed]

开发者 https://www.devze.com 2023-04-06 07:23 出处:网络
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

开发者_JS百科 Improve this question

Hi 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消