EShell中的多行输入
EShell中有没有多行输入的方法? 当我想在 EShell 的命令行中进行快速函数定义时,它实际上不起作用。我尝试使用显式换行符 (\n)、单引号 ('') 和双引号 (""),但没有成功。
当我编写换行符 \n
并按 Enter 键(点位于位置 *)时,我收到一条错误消息和一个新的 eshell 提示符。
$ (def foo (x y ) \n *)
Symbol's function definition is void: def
当我使用 Cq Cj
并按 Enter(点位于位置 *)时,我收到相同的错误消息和新的 eshell 提示符。
$
(def foo (x y) *)
Symbol's function definition is void: def
Is there a way for multi-line input in EShell?
When I want to do a quick function definition at the commandline of EShell, it doesn't really work. I tried using explicit linebreaks (\n), as well as single-quotes ('') and double quotes (""), but with no success.
When I write a newline \n
and press enter (point is at position *) I get an error message and a new eshell prompt.
$ (def foo (x y ) \n *)
Symbol's function definition is void: def
When I use C-q C-j
and press Enter (point is at position *) I get the same error message and a new eshell prompt.
$
(def foo (x y) *)
Symbol's function definition is void: def
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须保留括号以防止 Eshell 过早地评估输入。另外,正如 phils 所指出的,
def
并未在现有的 Elisp 中定义;你可能想要defun
。You have to leave a parenthesis open to prevent Eshell from evaluating the input prematurely. Also, as pointed out by phils,
def
is not defined in stock Elisp; you probably wantdefun
.没有
(def)
。在 elisp 中,您可以使用
(defun)
定义函数。请参阅 Chf
defun
REThttp://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Functions.html
There is no
(def)
.In elisp you define functions with
(defun)
.See C-hf
defun
REThttp://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Functions.html