关于daemon模式已经写过两次了,代表了我对这个功能认识的两次飞跃,这次是emacslient的参数:

‘-a COMMAND’
‘–alternate-editor=COMMAND’
Specify a command to run if ‘emacsclient’ fails to contact Emacs.
This is useful when running ‘emacsclient’ in a script.

As a special exception, if COMMAND is the empty string, then
‘emacsclient’ starts Emacs in daemon mode (as ‘emacs --daemon’) and
then tries connecting again.

The environment variable ‘ALTERNATE_EDITOR’ has the same effect as
the ‘-a’ option. If both are present, the latter takes precedence.

Emacslient

-a参数可以指定在Emacs没启动的时候要运行的程序,这是我之前就知道的;但后面一段我以前没注意:如果为空则以daemon模式启动Emacs。

这不就是我想要的么

子曰:「仁乎远哉?我欲仁,斯仁至矣。」

《论语·述而》