Emacs 如何自动化一系列M-x选项?

Emacs 如何自动化一系列M-x选项?,emacs,Emacs,我将给出一个明确的例子。我经常需要在连接到计算机的设备上启动nrepl会话,并使用以下命令序列: 1. M-x nrepl 2. host: <I write the hostname here> 3. port: <I write the port here> 1。M-x nrepl 2.主持人: 3.端口: 如何将此序列绑定到一个可以键入的命令中?f1 fnrepl: nrepl is an interactive autoloaded compiled Lisp

我将给出一个明确的例子。我经常需要在连接到计算机的设备上启动nrepl会话,并使用以下命令序列:

1. M-x nrepl
2. host: <I write the hostname here>
3. port: <I write the port here>
1。M-x nrepl
2.主持人:
3.端口:
如何将此序列绑定到一个可以键入的命令中?

f1 f
nrepl

nrepl is an interactive autoloaded compiled Lisp function in
`nrepl.el'.

(nrepl HOST PORT)

Connect nrepl to HOST and PORT.
因此,
(nrepl“0.0.0.0”“3000”)
可能是您想要的东西。 我没有使用它,因为我只是在中使用了
nrepl插孔,或者从最近开始

苹果酒插孔

这真的是n00bish(我还不是emacs的超级用户),但我该如何运行该功能?我通常也会使用nrepl插孔,但这是用于android开发的。您如何运行它?
M-:(nrepl“0.0.0.0”“3000”)
或定义执行此操作的命令:
(defun foo()(交互式)(nrepl“0.0.0”“3000”)
,然后
M-x foo