Emacs:没有窗口系统的启动

ash*_*ash 2 linux emacs

我知道在没有窗口系统的情况下启动 emacs,我这样做:

emacs -nw filename.txt
Run Code Online (Sandbox Code Playgroud)

但是,我不想经常指定 -nw 。我在我的 .emacs 中添加什么来自动执行此操作?

Nat*_*ter 5

根据 shell 中的平台,我相信您可以在 bashrc 或 bash_profile(取决于需要)中添加别名,以便 emacs 被解释为 emacs -nw

  • 我认为这个答案和它会得到的一样好。我运行了一个实验,将变量 'window-system 设置为 nil 作为 .emacs 文件中唯一完成的事情,然后从终端启动 emacs。正如预期的那样,它没有效果。作为使用别名的替代方法,可以使用脚本(emacs.sh 或 emacs.bat)而不是直接调用可执行文件。 (2认同)