简体   繁体   English

带有“ emacs-startup-hook”的“ other-window”错误

[英]error with “other-window” with “emacs-startup-hook”

When I open emacs, I would like to see the following: 当我打开emacs时,我希望看到以下内容:

2 windows, left window is for editing the document and the right windows run the program "multi-term" 2个窗口,左窗口用于编辑文档,右窗口运行程序“ multi-term”

I tried to edit my ~/.emacs with: 我试图用以下命令编辑〜/ .emacs:

(add-hook 'emacs-startup-hook 'other-window)
(add-hook 'emacs-startup-hook 'multi-term)
(add-hook 'emacs-startup-hook 'split-window-horizontally)

the last two commands work, ie I get 2 windows, one in left and one in right and the left one runs multi-term. 最后两个命令有效,即,我得到2个窗口,一个在左边,一个在右边,左边的一个运行多个项。 (Althought I wanna the converse). (本来我想相反)。 But the command 但是命令

(add-hook 'emacs-startup-hook 'other-window)

doesn't work. 不起作用。 I get 我懂了

wrong number of arguments: other-window, 0

Why? 为什么? I think I can do everything if I type a correct function name, if this function really works if I type it in Emacs with Mx function_name. 如果我输入正确的函数名称,并且我在Emacs中使用Mx function_name键入此函数确实有效,那么我可以做所有事情。

How could I resolve this problem? 我该如何解决这个问题?

The command other-window takes an argument, which you're not providing. 命令other-window接受一个您未提供的参数。 When you hit the keys Cx n , the argument is filled in for you automatically. 当您按下Cx n键时,参数将自动为您填充。 Try: 尝试:

(add-hook 'emacs-startup-hook (lambda () (other-window 1)))

Or, you could mimic the keystroke by doing: 或者,您可以通过执行以下操作来模仿按键:

(add-hook 'emacs-startup-hook (lambda () (call-interactively 'other-window)))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM